what is the purpose of class "Object" which is base class
for all classes?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
What is an argument java?
Which methods are used during serialization and deserialization process?
How to use arraylist in java netbeans?
What are other modifiers?
"we cannot create an object of interface but we can create a variable of it".diacuss the statement with the help of an example.
What are the methods of object class ?
What is passing value java?
How a string is stored in memory?
Difference between abstract and concrete class ?
Why string objects are immutable in java?
How many bytes is a string java?