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 ?
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.
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
Joined: Jan 27, 2001
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
Joined: May 19, 2001
Hi Johannes, Thanks. I stand corrected. Regards, Kezia.