This question has been repeatedly asked and discussed here, and there is no answer. People don't agree on what "pure OO" means. So, unless you define what you think it means, nobody can give you a meaningful answer.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
"object-oriented" is a design concept. There can be many, many different ways to program in an "object-oriented" way.
A "pure" object-oriented language would be one that supported "object-oriented" design concepts.
Whether something is pure or not would depend upon how the programmer writes a program. One can certainly create pure OO programs with Java. And one can certainly create programs that are not object-oriented with Java.
Java is a pure OO language. If you think it is not, then please describe some "object-oriented" thing that you cannot implement using Java.
With "pure OO", people often mean that everything is an object. That's not the case in Java, because in Java there are for example primitive types, which are not objects - so because of that reason, they say Java is not a pure OO language.
Yes, Ruby has operators, but they are more or less just methods with funny names and can be redefined or overloaded if you like. You can use the normal method call syntax with operators in Ruby (altough it looks a bit silly):
I don't really agree that having operators means that it is "less OO". You could also say that methods are not objects and therefore it's not "pure OO".
In Ruby things like the "if" operater aren't objects--does that make it less pure? How about in Smalltalk?
Re: Java's OOPness--I've *always* considered it OOPLite, because I came to it from a Smalltalk background. Arrays are particularly irksome; I don't feel I should have to use a static utility class to directly manipulate an array. If arrays were "real" objects I wouldn't have to.
(And personally I *would* say if methods aren't objects (although we can *get* a method's object) that it's "less pure.")
Joined: Apr 16, 2008
Primitive types which belong to objects does not make Java not "pure OO". To be hard-headed, everything is converted to machine language anyway so the concept of everything being an "object" is weak. Nothing is an "object" when it is executing, its all binary data.010101010101010101010101010no objects here
I do not know if a language is purely object oriented or impurely object oriented. To me a language is either Object Oriented or it is NOT. Correct me if I am wrong.... what we learnt from our BASICS it suggests:-
A language is object oriented if:
1. It has Polymorphism.
Also note that two aspects come as by-products in OOPs:
1. Coupling: Two classes are said to be tightly coupled if they know each other's functionality and purpose.
2. Cohesion: The class focuses exactly on the reason for which it is made.
I guess JAVA is indeed an Object Oriented Programming Language...if the above definition is correct.
my point about Ruby and operators was less about Ruby being 'pure OO' that it was supposed to illustrate that DIFFERENT PEOPLE CONSIDER "PURE OO" TO MEAN DIFFERENT THINGS.
Nobody's definition is more or less valid (well, ok, SOME are less valid). I don't care if you consider Ruby, Java, Smalltalk or even C pure OO or not, because we're all going to consider the phrase to mean something different.