Literals ( Java )

Integer Literals
Integers are the most commonly used type. The three bases used are Integer literals can be assigned from int to other integer types such as byte or long, as long as the value are within thier range.
 * 1) Decimal ( base - 10 )
 * 2) Octal ( base - 8 ) -- denoted by leading 0.
 * 3) Hexadecimal ( base - 16 ) -- denoted by leading zero-x ( 0x or 0X )
 * Long literal are denoted using upper or lower case 'L'. Eg., 0x7fffffL.
 * Binary are denoted using prefix 0b or 0B. Eg., int x = 0b1010 ; ( from JDK 7 )


 * To make reading large integer values easier, underscores can be used inbetweenn numbers to split them into groups. During compilation, these underscores are removed. Eg., int x = 123 __456__789 ; Useful when encoding telephone numbers, ID numbers, etc. ( from JDK 7 )