//程序员 郭晋生 2017.9.25
//1.输出一个长整型的变量 123456789012345
public class Long{
public static void main(String[] args)
{
long l=123456789012345l;
System.out.println(l);
}
}
//2.输出一个单精度的小数常量 2.4
public class Float{
public static void main(String[] args)
{
float f=2.4f;
System.out.println(f);
}
}
//3.输出布尔类型的变量
public class Boolean{
public static void main(String[] args)
{
boolean b=true;
System.out.println(b);
b=false;
System.out.println(b);
}
}
//4.强制类型转换
public class Byte{
public static void main(String[] args)
{
byte b=3;
b=(byte)(b+200);
System.out.println(b);
}
}
//5.输出字符型的加法计算
public class Sop{
public static void main(String[] args)
{
System.out.println((char)('a'+1));
System.out.println((char)('你'+1));
}
}
//6.功能:演示变量的溢出效果
public class Max{
public static void main(String[] args)
{
int i=Integer.MAX_VALUE+1;
System.out.println(i);
}
}
//7.给x赋值,进行x=x/1000*1000的计算并输出结果
import java.util.Scanner;
public class Math{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
double x;
System.out.println("Enter the x ");
x = Double.valueOf(input.nextDouble());
x=x/1000*1000;
System.out.println("The calculation result is " + x);
}
}