zds9924
发贴: 16
积分: 0
|
于 2004-09-24 13:52
//java.lang.object类
1.equals():比较状态和功能上的相同
Integer one = new Integer(1) , anotherOne = new Integer(1); if(one.equal(anotherOne)){ System.pringln(""objects are equal");} //return true
2.getClass()
是final方法, void printClassName(object obj) { System.out.println("The object's class is "+obj.getClass().getName(); }
创建一个类的实例,所创建的对象可以是任何类
object createNewInstanceof(object obj) { retuen obj.getClass().newInstance(); }
3.toString()
返回对象的字符串表示
System.out.println(Thread.currentThread().toString());
4.finalize();
5.notify(),notifyAll(),wait() 用于多线程中的同步
//成员变量
。static:类变量 。final:常量 。volatile:共享变量
zds9924 edited on 2004-09-24 13:59
|