// This program illustrates the use of Java datatypes.
import java.io.*;
import java.lang.*;
public class Code3
{ //begins Nums
public static void main(String args[])
{
int x= 5;
int y= 2;
int z = 0;
long a, b = 0;
double d= 5.12345;
byte c = 0;
//float e = 34.2; compiler error: (1)
float e = 34.2F; //or float e = (float) 34.2;
short f,g,h;
f =2; g = f;
//h = f * g; complier error (2)
//c = a; compiler error (3)
//z = 5L; compiler error (4)
a = 6; //promotion of int to long
b = 1000L;
z = (int) (5000L + b); // (5)
c = (byte) (x*y); // (6)
a = c;
System.out.println(c);
System.out.println(c * a);
System.out.println(b);
z = (int) d; // lose decimal places
System.out.println(z);
} //end main
} //end Nums
