Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java pure Object Oriented ?

 
Deepak Mahbubani
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per Core Java, Java is a pure Object Oriented Language.
However, some claim that since java has native types like int, float which are not objects, Java is NOT a purely OO language.
Smalltalk on the otherhand is purely OO.
Can anyone explain is Java really is purely OO ?
And what exactly is a purely OO language ?
 
Kezia Matthews
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepak,
A pure object oriented language is one in which all the code is written within the body of the class. This means all the variables and functions would be a part of the object of the class; except in the case of static members, which belong to the class as a whole and not to any particular object. No floating code exists.
Java is a pure object oriented language.
int, float, etc are primitive datatypes of the Java language and I don't think that, this has anything to do with the language being object oriented. Java also provides wrapper classes (Int, Float, etc for int and float datatypes respectively) for all the primitive data types, which can be used where the primitive types need to be used as objects.
Regards,
Kezia.
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a lot of discussion going on about the "pureness" of Java's OO implementation.
Look at This discussion for instance
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can also recommend a search on Google Groups Advanced
Search on Pure OO in the *JAVA* newsgroups
and see the # hits. Have fun
By the way Kezia I think the general consensus is that Java can NOT be considered a pure OO language
 
Kezia Matthews
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Johannes,
Thanks. I stand corrected.
Regards,
Kezia.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic