wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Why is the superclass named as 'Object' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why is the superclass named as Watch "Why is the superclass named as New topic

Why is the superclass named as 'Object'

Vijay Gopinath

Joined: Dec 28, 2005
Posts: 4
A question so simple , yet confusing to decifer , why is the superclass of all classes in java named as 'object' class ? It could be anything else , any particular reason/thoughts for the same would be helpful.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37884
I always thought that in object-oriented programming all objects are objects so you call them Object . . .
Sanjaya Sugiarto
Ranch Hand

Joined: Mar 25, 2004
Posts: 229
What would be a better name in OO-language that the superclass called Object?
Interesting question, for exact answer you should ask James Gosling though.

<a href="http://www.wi.hs-furtwangen.de" target="_blank" rel="nofollow">Business Information Technology - Hochschule Furtwangen University, Germany</a>
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Not all OO languages have a single common superclass of all objects, but where they do so, "Object" seems a pretty good name for it!

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
marc weber

Joined: Aug 31, 2004
Posts: 11343

Objects will be Objects.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'm pretty sure if I invented an OO language with a single ancestor at the top, I'd call it BOB. The framework I use has BOB-Objects and that just makes me very happy. Yup, BOB.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60739

BOB, would probably raise the ire of Microsoft (although they might be trying to forget all about BOB, who knows?), so I'd probably choose Fred.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Henry Wong

Joined: Sep 28, 2004
Posts: 18496

Microsoft BOB... now that was a cool name for a product.

What did it do again? ...


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
MS BOB was a competitor to IBM TopView wasn't it?
Manoj Kumar Ravikanti

Joined: Aug 18, 2006
Posts: 11
It ts very good question and must be ansarable.Every class extends Object class Because of 2 resion,one is for security resion & other for utilities purpose.If a class Extends Object class ,then after jvm,cosider this program is secure program(thats the only way that jvm know program compile by bug free compiler or bug compiler).Other is about the utilites,thats G.C,&other functionalites.
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Originally posted by marc weber:
Objects will be Objects.

Objects will not be Objects (all the time).

If you are not laughing at yourself, then you just didn't get the joke.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Java is an object oriented language, so everything we create in Java is-an object.

Inheritance represents an is-a relationship with all parents, or specifically, ancestor classes. Since all classes in Java inherit, at the top of the tree, from a class called object, then we can honestly say that EVERY class we create is-an Object.

I just love the elegance of Java. It's everywhere, even in the little things like the Object class.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

Originally posted by Vijay Gopinath:
It could be anything else

"Object" seems the most logical to me. Are there other possibilities that make more sense to you?

[Jess in Action][AskingGoodQuestions]
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
I'm torn between Doohickey and Thingamajig.

"I'm not back." - Bill Harding, Twister
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
How about BaseClass? After all it is a class, not an object.

Still, it really doesn't matter why they named it Object.

"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It is interesting that they didn't have to have a common ancestor to everything if they didn't want to. In a strongly typed language it's good to have a place like this to put useful behavior. Look at the methods on Object. Could they have implemented these some other way without a single ancestor?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

What about extending from a common class called Problem.

Then we could say: everything we code in Java is-a Problem

What else? Nuisance? ThingForSomeoneElseToDO? Challenge?
Dana Bothner-By
Ranch Hand

Joined: Jul 28, 2006
Posts: 37
Originally posted by Rusty Shackleford:
How about BaseClass? After all it is a class, not an object.

Last time I checked, every class was a class, but its instances are objects, and classes tend to new named after their objects, not? Actually, if we are suggesting new names, I like "Om", the sound that created the universe. Why not say it now, "Ooommmm". Ah...
I agree. Here's the link: http://aspose.com/file-tools
subject: Why is the superclass named as 'Object'
Similar Threads
Doubts about references
Widening beats boxing?
Reference variable casting mechanism
Why Superclass of all classes is named as Object