Tuesday, November 29, 2011

Why should every class in java extend Object class?

In java u can access the data through objects.Here Object class is a super/base/parent class for all the java classes,so it will be hold all class objects of java.And also whenever u can serialize the object into the Stream we must store as form of ObjectStream object only and at the time of Deserialize the object from the Streams, u must get it as form of Object class object only.After that u must casting the object to u r Knowing class.
Category:Java Interview Questions

No comments:

Post a Comment