public static class test {
private int inta;
private boolean bool;
private String str;
private double doub;
private Double doubclass;//
基本类型的引用如果是以大写开头的就是引用一个类,类必须给它初始值(通过创建对象)才会分配空间不然会为NULL的空指针,而小写
//开关的就是已经给定了初始值的对象
}
prt(tes.inta + "---inta\n" + tes.bool + "---bool\n" + tes.doub + "---doub\n" + tes.doubclass + "---doubclass\n"
+ tes.str + "---str\n");
输出结果:
0---inta
false---bool
0.0---doub
null---doubclass
null---str