Every class becomes subclass of the OBJECT Class , but if we create a class (say A ) and if there is another class (say B) and if B extends A ........How can it become the sub class of both A and OBJECT ????

Questions by sudhu5555   answers by sudhu5555

Showing Answers 1 - 3 of 3 Answers

Ramakanta

  • Mar 31st, 2006
 

very good site

  Was this answer useful?  Yes

HSridhar

  • Apr 3rd, 2006
 

Generally every class is a sub class of Object class.

This is because JVM requires certain linking and loading of classes during runtime whenever an object instance is created. Many of such native methods are encapsulated in Object class. More over use of string concatination with an object instance reqires a code in tostring() method which is provided in Object class

Java does not support mutliple inheritance but an instance of base class can have a reference of subclass in inheritance hierarchy.

So A become the immediate parent of B but Object is ansector class of this hierarchy group hence we say B is a sub class of both A and Object class.

  Was this answer useful?  Yes

KAPIL GUPTA

  • Apr 5th, 2006
 

ya its a very good site

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions