2.1关键字
Java是一种严格的类型化语言,Java处理的每一个数据 都必须指明类型,正是因为这样的规定, Java 才具有 了良好的安全性与健壮性。
关键字(key word)是电脑语言里事先定义的,包括具 有特殊意义的标识符和特殊意义的变量。
2.1关键字
abstract case continue enum for instanceof new return switch transient assert catch default extends goto int package strictfp synchronized try boolean char do final if interface private short this void sd class double finally implements long protected static throw volatile byte const else float import native public super throws while
2.3.5 引用数据类型
程序运行结果:
a is 1 b is 2 x is java.awt.Point[x=0,y=0] y is java.awt.Point[x=1,y=1] Performing assignment andsetLocation... a is 3 b is 2 x is java.awt.Point[x=5,y=5] y is java.awt.Point[x=5,y=5]
2.3.5 引用数据类型
不能对原始类型调用方法,但可以对对象调用方法:
int j = 5; j.hashCode(); //错误 Integer i=new Integer(5); i.hashCode(); //正确