When you create a variable, array, or method you need to give it a data type. I wont go to in-depth with all the various data types but I will list just a few. Java like C/C++ and C# have strict typing. What that means is you need to say what type of data a variable, array, or method is or will return. These data types include text, numbers, and objects.
Number data types include int, float, and double
int is for any whole number with in a certain range and includes negative numbers as well.
int age = 23;
int temp - 32;
float is a single precision point decimal number
float pressure = 5.5;
float meters = 3.7;
double is a double precision point decimal and all decimal types are considered double.
double percent = 98.56;
double ratio = 1.56;
For text there is char and String
char is for a single character
char money = '$';
char percent = '%';
String is for text
String name = "Pein";
String quote = "Never die alone.";
Type casting/conversion is when you change one type into another.
double percent = 89.45;
int num = (int)percent;
As you can see I turned the percent variable into an int type by adding (int) in front of the variables name. num now has the value of 89. When you type cast from double to int you drop off the decimal point from that number. No rounding happens when this is done.
Hope this helps you.