well it's not that hard to comprehend
here's a few pointers:
int = integer (numeric value)
float = a "Real" number, with also values after the decimal '.'
double = also a real number, but with a maximum of 2 values after the '.'
char = A (keyboard) character, or any other character for that matter, it's defined as 'a','1',';' etc...
String = An (sort of) array of characters, which allows to make complete words\sentences\text.
now about the whole 'public' thing - this defines who can "see" our variable:
- public - anyone can see it.
- private - only the specific class in which the variable is defined can see it.
- protected - only the specific class and the classes that extend it can see the variable.
there are also arrays, or collections of variables, which you will see as
int[] objectId - an array of integers
FastList<String> - a list of strings
and as for the final\static thing:
if there's a final before the variable definition - then this variable can(and must be) only be defined once - and this value will remain it's value 'forever'
static - means this variable can be used with a static reference, for example, in L2Character class you will find:
Code: Select all
public static final byte ZONE_PEACE = 1;
and throughout the code you can find static references to id, for example
Code: Select all
if (player.isInsideZone(L2Character.ZONE_PEACE)) return;
L2Character.ZONE_PEACE is a static reference
anyways hope this helped
