Data-Fundamentals1
Primitive Data Type:
Name Size Range
byte 8 bit -27 to 2 7-1
short 16 bit -215 to 215-1
int 32 bit -231 to 231-1
long 64 bit -2 63 to 2 63-1
 
Declaring Integrals:
Decimal 45
Octal 045(Zero not letter O)
Hexidecimal 0x45
Octal DataType
Group 000 001 010 011 100 101 110 111
Symbol 0 1 2 3 4 5 6 7
 
Hexa-Decimal Data Type
Group 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Symbol 0 1 2 3 4 5 6 7 8 9 A B C D E F
Example

 public class JavaTemplate1
{
public static void main(String[] args) throws IOException {
System.out.println("main block executing");
JavaTemplate1 jt = new JavaTemplate1 ();
jt.amethod();
}
public void amethod(){
int oi= 045; // octal version 4 x 8 plus 5
int j = 45;//
int k = 0x42;//Hex version: 4x 16 plus 4
System.out.println(oi);
System.out.println(j);
System.out.println(k);
}


}

 
Displays: