aspose file tools*
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
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
Author

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

Abhishek Chattopadhyay
Greenhorn

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 ?

Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
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
Bartender

Joined: Sep 18, 2000
Posts: 582
    
    7

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: http://aspose.com/file-tools
 
subject: [B]Object Oriented Nature Of JAVA[/B]