what is the purpose of class "Object" which is base class
for all classes?

Answers were Sorted based on User's Feedback



what is the purpose of class "Object" which is base class for all classes?..

Answer / vikki

The Object class sits at the top of the class hierarchy
tree in the Java development environment. Every class in
the Java system is a descendent (direct or indirect) of the
Object class. The Object class defines the basic state and
behavior that all objects must have, such as the ability to
compare oneself to another object, to convert to a string,
to wait on a condition variable, to notify other objects
that a condition variable has changed, and to return the
object's class.

Is This Answer Correct ?    9 Yes 2 No

what is the purpose of class "Object" which is base class for all classes?..

Answer / lakshmi

object class is a base class for all class in java.using
this class we can call from super class methods and
variables to sub class

Is This Answer Correct ?    3 Yes 1 No

what is the purpose of class "Object" which is base class for all classes?..

Answer / piryabrata patro

listen first , when you create object of one class which is not extending any class than , instead of one object , two object will be created and that is nothing but object of Object class and one more thing is no object is created with out it's superclass. So, object of subclass can not be created without it's superclass where Object class comes into picture because by default compiler gives Object class as superclass to all class which is not extending any class at compilation time itself.

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More Core Java Interview Questions

What restrictions are placed on method overriding in java programming?

0 Answers  


Can you call a method in a method?

0 Answers  


Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.

3 Answers  


What access modifiers can be used for variables?

0 Answers  


What does @override mean?

0 Answers  


What is high level language in computer?

0 Answers  


Tell me the latest versions in java related areas?

0 Answers  


What is Java Annotations?

0 Answers  


Can list be null in java?

0 Answers  


How to add panel to a Frame?

5 Answers  


What is a null point?

0 Answers  


What is a method vs function?

0 Answers  


Categories