• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Abhishek Chattopadhyay
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic