Just came this question into my mind.
As Object is superclass of all classes in
Java, so is the superclass of
String class.
But Object Class has toString method in it which has return type of "String" (its child class). And String is the class with Object as parent class. So how this circular dependeny got managed at the time of creating initial version of Java by Java creators. How the compiled Object class against its dependency with its child class?
Did they removed the toString method initially to compile Objecl class successfully and then after compilation of String class against properly compiled Object class they added toString method to Object class back and compiled Object class again with compiled String class?
This question just came out of curiocity in my mind. May be stupid question/answer would be stupid.??
Regards,
Pras