Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Why java.lang.Object class is concrete class? Why not it is a abstract class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why java.lang.Object class is concrete class? Why not it is a abstract class? " Watch "Why java.lang.Object class is concrete class? Why not it is a abstract class? " New topic
Author

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

kopparapu v kiran kumar
Ranch Hand

Joined: Oct 16, 2008
Posts: 32

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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Aug 16, 2005
Posts: 14194
    
  20

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Aug 16, 2005
Posts: 14194
    
  20

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?
 
GeeCON Prague 2014
 
subject: Why java.lang.Object class is concrete class? Why not it is a abstract class?