what is the object class written in?
i was wondering, what is the object class written in? i mean it has method toString, but String extends Object!!!! and why can't i extend String? String shud not b a final class..... and what is the String class written in? what is the Class class written in? like what language?
[287 byte] By [
Astrofa] at [2007-10-2 6:44:48]

but, how? like object is the root of all classes, so how can it b written in java? and String extends Object, but Object and String both have a toString method, but its like a paradox.
no, but Object has a toString method, and String extends Object, also, what r the classes written in?
> no, but Object has a toString method, and String
> extends Object, also, what r the classes written in?
Java has no problems with mutual References. As one person stated you can look at the source code yourself for Object.java, String.java, or even Class.java. They are in src.zip of the JDK.
If mutual class definition is confusing you, then the declaration for [url http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html]Enum<E extends Enum><E>>[/url] should really through you for a loop:
public abstract class Enum<E extends Enum><E>>extends Object implements Comparable<E>, Serializable