File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes [B]Object Oriented Nature Of JAVA[/B] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "[B]Object Oriented Nature Of JAVA[/B]" Watch "[B]Object Oriented Nature Of JAVA[/B]" New topic

[B]Object Oriented Nature Of JAVA[/B]

Abhishek Chattopadhyay

Joined: Jan 10, 2008
Posts: 4
Hello Ranchers,

I came across the fact, while browsing few technical forums that JAVA is not a purely object oriented language.
It says that variables in java are primitives and not objects. The value of a primitives are stored in fields or stack rather than in heap as in case of an object oriented language.

Can any one put some more light on this ?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46412
More a case of semantics than anything else.
Primitives are stored as their actual value; as fields on the heap, as local variables on a stack. This simplifies the language; you can write "int i = 123;" rather than "Integer i = new Integer(123);" and saves the compiler having to convert 123 from an int to an Integer and back to an int when you use it.
There is lots written about "not a real OO language," which I think is mostly nonsense.

Any other opinions?
Steve Fahlbusch

Joined: Sep 18, 2000
Posts: 602

This is more suited to the beginning forum then here, but as there have been lots of posts on this search in the beginning forum (and here if you want) and you will find this has been discussed many, many times.

But basically, there is no one, official, agreed upon definition of pure object oriented language, as such any effort discuss this is simply a poor academic exercise without much merit.
I agree. Here's the link:
subject: [B]Object Oriented Nature Of JAVA[/B]
It's not a secret anymore!