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]
# 1
The String and Class classes are written in Java, as a review of the src.zip file reveals.
ChuckBinga at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 2
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.
Astrofa at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 3
There's no paradox. Method toString() returns a String object. So what? There's no rule that says that a method of a certain class can't return an instance of that same class.
jesperdja at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 4
no, but Object has a toString method, and String extends Object, also, what r the classes written in?
Astrofa at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 5

> 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.

Caffeine0001a at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 6

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

Caffeine0001a at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...
# 7
oh ok that's cool. yeah, Enum's r weird......
Astrofa at 2007-7-16 13:53:19 > top of Java-index,Administration Tools,Sun Connection...