Integer
public class IntegerDatatype {
public static void main(String[] args) {
int a=100,b=200,c; /*Integer variable declaration.
They can contain values in range of 4 bytes only*/
c=a+b;
System.out.println("Value of Integer variable= "+c);
/* for storing large numbers we use BigInteger datatype*/
String bigNum="12345678913256798864";
BigInteger big=new BigInteger(bigNum);
System.out.println("Value of Big Integer variable= "+big);
}
}
Output:
Value of Integer= 300
Big Integer= 12345678913256798864