CHAPTER 8
The Object Class
In Chapter 7, we have seen that there is single inheritance of classes in Java, i.e. a class cannot have more than one direct super-class. Every class in Java has a direct super-class, if we do not declare a super-class while defining a class then the compiler assumes the Object class to be the super-class. Only the Object class does not have any super-class. In Java any instance which is created has certain minimum behaviour. When an instance of any reference type is created, it has certain methods always available. These are the methods which are inherited from the Object class. These methods are also available on instances of arrays. Object class is the root of the class hierarchy, defining the minimum set of methods ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access