import java.util.Scanner;
public class L {
public static void main(String[] args) {
long a ; //练习题1:输出一个长整型的变量 123456789012345
a=123456789012345l;
System.out.println(a);
float b=2.4f; //练习题2:输出一个单精度的小数常量 2.4
System.out.println(b);
boolean c=true; //练习题3:输出一个布尔类型的变量
System.out.println(c);
c=false;
System.out.println(c);
byte d=3; //练习题4:强制类型转换
d=(byte)(d+200);
System.out.println(d);
System.out.println((char)('a'+1));//练习题5:输出1个字符型的加法计算
System.out.println((char)('你'+1));
int e=Integer.MAX_VALUE+1; //练习题6:int 也对应着一个类,Integer 演示变量的溢出效果
System.out.println(e);
![](https://images2017.cnblogs.com/blog/1236945/201712/1236945-20171218140243787-198894222.png)
@SuppressWarnings("resource") //练习题7:算术运算符+-*/
Scanner input=new Scanner(System.in);
double f;
System.out.println("Enter the x ");
f = Double.valueOf(input.nextDouble());
f=f/1000*1000;
System.out.println("The calculation result is " + f);
}