Java

Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.

Source: Wikipedia

Notes

I'm currently trying to broaden my horizons by learning more back end oriented programming languages, with Java being the first step.

Types

Java is a statically typed language, meaning the type of a variable has to be specified by the developer. This results in a variable's type being known at compile time (as opposed to at run-time). This is done as follows:

int gear = 1;

This means that a variable called gear exists, is of type integer (a whole number, as seen below), and holds an initial value of 1.

Primitive data types

There are eight primitive data types in Java.

byte

  • 8-bit signed integer

  • Can have values between -128 through 127 (inclusive)

  • Can be used for saving memory in large arrays

short

  • 16-bit signed integer

  • Can have values between -32,768 through 32,767 (inclusive)

  • Can be used for saving memory in large arrays

int

  • 32-bit signed integer

  • Can have values between −2,147,483,648 through +2,147,483,647

long

  • 32-bit signed integer

  • Can have values between −9,223,372,036,854,775,808 through 9,223,372,036,854,775,807

float

  • single-precision floating point number

work in progress...

Last updated