This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Superclass of all classes is named as Object  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone tellme why Superclass of all classes is named as Object and not some other name say x,y,z
 
author
Marshal
Posts: 23435
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mythili Sathya wrote:Hi,

Can anyone tellme why Superclass of all classes is named as Object and not some other name say x,y,z




Well, if it was named x, then would this topic be "Why Superclass of all classes is named as x"? It has to be named something -- and Object sounds pretty good.

Henry
 
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, in java is an object oriented language. Data and business processes are encapsulated in entities called as objects. The primitive data types are pretty much used directly only by the programmer in developing coding logic. Hence objects form the foundation over which everything in java executes. In order to impart some generic properties to these objects we have the class "java.lang.Object", defined in the "java.lang" package. This class provides some common functionalities in the form of methods like "equals()","toString()", "hashcode()" etc. Hence all classes automatically inherit from Object and i guess the name "Object" is apt for it, rather than say X,Y or even Z....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!