Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why java.lang.Object Class not abstract?

 
sruthi adhuri
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a new bee to Java. My Q'n is Why java.lang.Object Class just a super class and not an abstract class? Is it because Object class implementation with all native methods?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are cases where you want to create an instance of a basic class for uses such as tagging, locking, keying and the like. While you could just as easily write an empty class that extends Object and provides nothing else, it provides nothing more or less than the Object class itself.

While I kind of agree that it could be abstract, I'm not too worked up about it There may also be some trickery in the Language spec and constructors that requires a concrete root class.
 
sruthi adhuri
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During my journey of learning java, I found some more key factors that are answering my dumb Q�n:
Every object is concrete class of Object class by default which should not be a abstract class or Sun might thought of defining life cycle methods of every object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic