This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
For more details, have a look at the Object Orinted Concepts.
All of these concepts are implemented in Java.
Umesh Vajpai
Greenhorn
Joined: Mar 14, 2010
Posts: 26
posted
0
Devaka Cooray wrote:For more details, have a look at the Object Orinted Concepts.
All of these concepts are implemented in Java.
Hi Deveka,
I know all OOP concepts.As it is noted in every book that java is purely object oriented but it has primitive types and that is why i having confusion regarding.Are you getting me?
These concepts define whether a language is Object Oriented or not. Since all of the OOP concepts are implemented in Java, it is an OOP language. Being OOP does NOT imply it shouldn't provide additional features, concepts, etc.
Umesh Vajpai wrote:Could anyone tell me please whether JAVA is purely object oriented or not?
Devaka answared already in his first post.
@ Sateesh: probably you are confused about the question Is Java *100 % * Pure Object Oriented ? . it is different from what Umesh asked.
Sateesh.B Kumar
Greenhorn
Joined: Sep 05, 2007
Posts: 6
posted
0
Seetharaman Venkatasamy wrote
@ Sateesh: probably you are confused about the question Is Java *100 % * Pure Object Oriented ? . it is different from what Umesh asked.
I think existence of primitive types doesn't make Java a pure (100%) object oriented language. Once a varaibles is declared to be of primitive type
it cannot be used polymorphically. I have read that Smalltalk is a much more object oriented than Java, but having no experience with Smalltalk I don't know how Smalltalk is better Object Oriented than Java.
Umesh Vajpai
Greenhorn
Joined: Mar 14, 2010
Posts: 26
posted
0
Hi Sateesh,
I even think this.Thanks to put light on this question.
In what ways is "purity" important (using no primitive
types)? I understand the discussion but wonder why
it seems so important to some. Please explain.
Jim Hoglund wrote:In what ways is "purity" important (using no primitive
types)? I understand the discussion but wonder why
it seems so important to some. Please explain.
It's important to theorists -- of which, I am way too pragmatic to be one. To me, what is important is how a feature is useful -- meaning to be used. To argue that a feature is within a bounds of a definition is kinda silly to me. And to argue that something is not within the bounds because it has a feature that is not within the bounds of a definition...
it's also important to college professors who are too lazy to come up with useful, meaningful lessons rather than relying on quick, easy topics like this.
fred rosenberger wrote:of course, now you have the problem that '7' isn't an object, but an integer value, so I don't know how you get around that...
Sure it is; 7.times { |n| puts n }
In any case, it's not *necessarily* important, as obviously a lot of work can be done in non-OOP languages, and has for decades. Where it gets interesting is discussing the relative expressiveness of languages, their ability to encapsulate abstractions, the presence (or lack thereof) of a MOP, and so on.
OOP sometimes gets a bad rap, but that's generally by people who use Java as their example language. Patterns, for example, often disappear into the language itself, or are used so naturally that you don't even know it's a capital-p Pattern. Some folks also have difficulty understanding there are different models of OOP (prototypal, like Self or JavaScript; multiple dispatch, like CLOS) because they're locked into a narrow understanding of what OOP really is.
Jesper Young wrote:What does "purely object oriented" mean exactly? Are there any languages that are 100% purely object oriented?
+1. Without a definition of what "purely OO" means, this question -and any answer to it- is meaningless. Languages exist that are decidedly more OO than Java (Smalltalk, for example), so I'd argue that Java most certainly is not pure OO.
Vinod Vijay wrote:Everything is defined under Classes
Except for the primitives. And operators. And it's not really "regular" in how it treats things (consider the Arrays class, instead of just operating on arrays, you have to multiple-dispatch).
OOPness is a continuum. When you look at a stronger OO language it's obvious Java isn't on that level. Does that mean it's not "pure" OOP? Not sure--but it's certainly weaker than some.
I agree with the experts here on Java.
Java is Object oriented, but for sure not 100% object oriented based on not supporting multiple inheritance(supports thru interface but not implementation wise), allowing primitive data type(s). C++ is more % of object oriented than Java.
Thanks
The reason is simple for each instance of JVM thier is atleast 1 object in the memory and also primitives cannot exist without existence of their containing object...
so in java without object you cannot do anything....
Saying that primitives can't exist without a containing object begs the question--primitives aren't objects, so any question of "purity" has already been answered: if an object can hold something that *isn't* an object, then non-objects must exist, destroying any notion of purity.
That aside, I don't think your answer really addresses the question--we're talking about the *language*, not its runtime environment. In an OOPL continuum, Java does better than some, worse than many.
shanky sohar wrote:however the language which are pure object oriented are Smalltalk, Eiffel and Simula
Smalltalk, Eiffel and Simula all contain operators ( + comes to mind). Operators are not objects. Therefor, Smalltalk, Eiffel and Simula are not pure OO.
so the conclusion of above discussion is
no language in this world is pure object oriented............
as every language contain operater like +,-,*,= etc................