3 ms·
Another oddity to think about in java source code: In regular Java, all objects extend java.lang.Object, including java.lang.Class. So how do you bootstrap buil
by 0x0 10y ago
Another oddity to think about in java source code: In regular Java, all objects extend java.lang.Object, including java.lang.Class. So how do you bootstrap building java.lang.Object from source?
- pjmlp 10y agoYou don't. This is part of the bootstraping process of a programming language. Usually such special types are built manually in the compiler data structures, or make use of special primitives, like native methods on Java's case.
- seanmcdirmid 10y agojava.lang.Object is just part of the VM. Same thing with native methods.
- 0x0 10y agoWhile many of the methods in java.lang.Object have a native implementation, there are still other methods that do sport a pure java implementation: http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/tip/src/share/classes/java/lang/Object.java http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/tip/src/share/...
- seanmcdirmid 10y agoSure, but...if you look at the JVMS, there are a lot of special cases concerning java.lang.Object to help with bootstrapping.