1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
// java.lang.Object
// An implementation of the Java Language Specification section 20.1
// Written by Charles Briscoe-Smith; refer to the file LEGAL for details.
package java.lang;
public class Object {
public final native Class getClass()
"return this->methods->myclass;"
;
public String toString() {
return getClass().getName()+"@"
+Integer.toHexString(hashCode());
}
public boolean equals(Object o) {
return this == o;
}
native public int hashCode()
"return (Javaint) (long int) this;"
;
// protected Object clone() throws CloneNotSupportedException {
// throw new CloneNotSupportedException();
// try {
// Cloneable c=(Cloneable) this;
// return nativeClone(this);
// } catch (ClassCastException e) {
// throw new CloneNotSupportedException();
// }
// }
// native private static Object nativeClone(Cloneable obj);
public final void wait()
throws IllegalMonitorStateException,
InterruptedException {
wait(0);
}
public final void wait(long millis)
throws IllegalMonitorStateException,
InterruptedException {
wait(millis,0);
}
public final void wait(long millis, int nanos)
throws IllegalMonitorStateException,
InterruptedException {
throw new IllegalMonitorStateException();
}
public final void notify()
throws IllegalMonitorStateException {
throw new IllegalMonitorStateException();
}
public final void notifyAll()
throws IllegalMonitorStateException {
throw new IllegalMonitorStateException();
}
protected void finalize()
throws Throwable {
// do nothing
}
}
|