Data types and Literals in Java
Data types Data types category: Data types summary: Literals A constant value which can be assigned to variable is called "Literal". Integral Literals All possible value of Integral data type(byte, short, int and long) are called Integral Literals. Default Value: By default every Integral literal is int type. When you assign a value in long data byte and that value is more than 2147483647(Maximum value for int) then compiler will give you error. Ex: long a = 3000000000; Error: The literal 3000000000 of type int is out of range Even though we have used long data type and value is also within range of long but still compiler gives error because every integral literal is int type. We can resolve this error by specifying long type explicitly. We can specify long type by suffixing l or L . Ex: long a = 3000000000L; Number System: Integral Literal can be represented as Decimal, Octal and Hexadecimal number systems. L...