Two Laptop Bag*
The moose likes Java in General and the fly likes Object class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Object class" Watch "Object class" New topic
Author

Object class

Mahesh Bamane
Ranch Hand

Joined: Mar 12, 2008
Posts: 68
Why Object class in not declared as an abstract in Java API, this is just out of interest. I've read few blogs on this but couldn't get much satisfied answer. So just thought of posting here.


There is nothing like trying, either you do it or you don't.
SCJP 1.5
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4447
    
    5

So that all things Java will have a concrete foundation? (cheesy)

Interesting question, never really thought to ask this before but I suppose it's not declared abstract because it has no abstract methods. I would think others elsewhere would have been given this answer. If so, why do you not find that satisfactory? If not, well, huh ... seems pretty straightforward.


Junilu - [How to Ask Questions] [How to Answer Questions]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18546
    
  40

Mahesh Bamane wrote:Why Object class in not declared as an abstract in Java API, this is just out of interest. I've read few blogs on this but couldn't get much satisfied answer. So just thought of posting here.


The problem with "WHY" questions, especially when related to classes since Java 1.0, is that you need to have one of the original Java designers to answer it. Any other answer (from someone else) would be speculating.

Personally, I don't know. But I can speculate why it hasn't been made abstract since (meaning "after") Java 1.0. My speculation is that it is possible to use an Object instance as a synchronization lock, and if they made it abstract after Java 1.0, it would have broken backward compatibility.

Henry

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4447
    
    5

Henry Wong wrote:you need to have one of the original Java designers to answer it. Any other answer (from someone else) would be speculating.

Or maybe just someone who tries to find the simplest, most logical answer possible (running and ducking)
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

from java.util.HashSet


i would have annoyed, for simple class creation required overriding. and as Junilu pointed out abstract class with out abstract methods are meaningless.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Object class
 
Similar Threads
wait() from within static method
Abstract Methods Vs. Static Methods
Synchronised block question?
Is an object an "instance" of a class?
accessing a static method