Alright so these are easy to memorize and easy to understand as well.

When a variable is created, it is temporarily stored in your RAM(Random Access Memory).

The variables for java are the following:

byte
short
int
long
float
double
boolean
char


Boolean values, as many of you with coding backgrounds know, must return true or false.

Now, a char varaible is from ASCII. You can find a list of what letter is what value just by googling.
int is the most commonly used variable. It can only hold a whole number, same goes for short, long, and byte.



A float variable can hold a vast number of decimal places while double only shows 2 places after the decimal.

You can declare a variable similar to this example.
Code:
int var123;
Or if you want it to have a starting value you could do this:
Code:
int var123 = 2;
If you have a lot of variables which start null(0), you can do them within one line. Here is an example.
Code:
int var1, var2, var3, var4;
I lost my train of thought >.< hmmm (Xepher's fault)

I guess this just about covers it. If I remember something else to add or you guys have something I can add let me know I'll be happy to add onto it.


› See More: [Java] Variables