• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why java.lang.Object class is concrete class? Why not it is a abstract class?

 
kopparapu v kiran kumar
Ranch Hand
Posts: 32
Chrome Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merry Crismastmas!!

I have a doubt like this:

Why java.lang.Object class is concrete class? Why not it is a abstract class?

What could be the reason behind making it as a concrete class??


Please clarify my doubt....

Thanks in advance!!
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kopparapu v kiran kumar wrote:
Why java.lang.Object class is concrete class? Why not it is a abstract class?

Java Designer might not be wanted to force you to override a method from object class.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:Java Designer might not be wanted to force you to override a method from object class.

That can't be the reason; an abstract class does not need to have any abstract methods that you would be forced to override.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:an abstract class does not need to have any abstract methods that you would be forced to override.

fine. but what is the need to make a class as an abstract, if the class does not have abstract method?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because a class may still represent some abstract thing that you don't want to be able to instantiate directly, even if it doesn't have any abstract methods.

Back to the original question: I guess that is just how the Java language designers chose it to be. Someone posted a long answer here: Why java.lang.Object is not abstract?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic