primitive types in java
Well.. primitive types in a nutshell are just the basic everyday things.. actually.. 4 things.
- Single Characters
You can read more about primitive types in java site
For numbers, there are different kinds of numbers but we will be mainly talking about the main three, which are used most often.
An int can hold values of -2,147,483,648 to 2,147,483,648.
A long can hold values of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808
A double can hold values of 2e-1074 to (2-2e-52)-2e1023 (HUGE)
ints are the selection for most scripters because they're easy to work with a pretty good in general.
longs are for BIG numbers like the milliseconds on a timer for a script.
doubles are for decimals like 2323.23242
Strings are used to hold text values like this.
String string = "HELLO THIS IS A STRING! AND I CAN HOLD TEXT VALUES!!";
Just holds a character value like this.
char a = 'A';
Pretty useful, can hold true or false values.
You can use them like this.
boolean b = false; //and then, in an if-statement, like this. if(!b) // if b is false if(b) // if b is true