• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Superclass of all classes is named as Object  RSS feed

 
Mythili Sathya
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
 
Henry Wong
author
Sheriff
Posts: 23295
125
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
 
Janardan Kelkar
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!