final
1)修饰变量代表的是常量
2)修饰方法,代表不能被重写
3)修饰类,不能被继承
Math 类 参见JDK 1.6中文版API
----------------------------------------华丽丽地分界线-----------------------------------------------------------------------
String类
1) String s ="hello world ";
String s2= new String ("hello world ");两者是等价的
但是 system.out.printIn(s==s2);结果是false,因为它俩不是一个地址
2) = =只能比较简单变量,如果是复杂类型的,比较的就是地址
所以复杂类型用的是system.out.printIn(s.equals(s2));地址里所对应的值,字符串的比较一定是equals来比较
String s ="hello world ";
String s1="hello world ";
system.out.printIn(s==s1);是true,可见这是String的特殊性
3)实际上equals不是String的方法,是Object的方法,String对Object进行复写了
4)字符串的相连
5)字符串中某一字符位置的查找
输出的是1(因为字符串是从0开始的)
6)字符串的截取