名字不能重复
变量未赋值,不能使用
long 类型的变量定义的时候,为了防止整数过大。后面加L
float类型的变量定义的时候,为了防止类型不兼容,后面加F
否则出现以下结果:
text1.java:15: 错误: 不兼容的类型: 从double转换到float可能会有损失
float f=12.14;
text1.java:12: 错误: 整数太大
long l=10000000000000;
public class text1 {
public static void main(String[] args) {
int a=10;
System.out.println(a);
a=20;
System.out.println(a);
boolean bb=true;
System.out.println(bb);
long l=10000000000000L;
System.out.println(l);
float f=12.14F;
System.out.println(f);
}
}