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.
fall down seven times, get up eight times-bodhidharman
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.
This message was edited 1 time. Last update was at by Sateesh Kumar.B
Umesh Vajpai
Greenhorn
Joined: Mar 14, 2010
Posts: 26
posted
0
Hi Sateesh,
I even think this.Thanks to put light on this question.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 25060
posted
0
Please search. This question comes up frequently and the usual conclusion is . . . "it all depends what you mean by 100% purely object-oriented."
Some people think that to be "pure OO", you can't have operators either. EVERYTHING would be a method. you would never do
Integer A = 7;
because '=' isn't an object. instead you would do
Integer A.setValue(7);
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...
Never ascribe to malice that which can be adequately explained by stupidity.
Jim Hoglund
Ranch Hand
Joined: Jan 09, 2008
Posts: 525
posted
0
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.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Jesper Young wrote:Are there any languages that are 100% purely object oriented?
IMO, yes (Java not fitting my mental model of one, however).
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
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.
As Kay says, C++ is *not* what he had in mind ;)
Ritesh Pareek
Ranch Hand
Joined: Nov 04, 2008
Posts: 50
posted
0
Ruby is one of the pure OOPS language although multiple inheritance is not there!!
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Multiple inheritance can be realized in different ways, though, not just through direct "classical" inheritance--consider what mixins give you.
Gauri Patil
Greenhorn
Joined: Mar 19, 2010
Posts: 2
posted
0
Yes java is pure OO,BUt in your pgm 'A' OR '7' is not objects but these are variables.objects are those on which behaviour or methods are pperated
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Java's operators aren't objects.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
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.
Everything is defined under Classes and no data is moved freely. And these Objects can only deal with the Classes.
Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
Vinod Vijay wrote:Everything is defined under Classes and no data is moved freely.
That'll be news to anyone who's ever used an "int".
Vinod Vinu
Ranch Hand
Joined: Aug 30, 2009
Posts: 217
posted
0
Yes, Java is a pure object oriented language.
Everything is written under classes, no data can flow freely beyond classes.
Only Objects can access it.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
Vinod Vijay wrote:Everything is written under classes
So where is "int" in the class hierarchy? (Note that auto-boxing does not make a primitive an object.)
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
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.
Anju Kumar
Greenhorn
Joined: Sep 08, 2003
Posts: 7
posted
0
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
Anju
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Multiple inheritance is not intrinsic to OOP, and is not necessary for a language to be OOP.
arun r mehta
Ranch Hand
Joined: Mar 08, 2010
Posts: 34
posted
0
Java is pure object oriented language..
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....
This message was edited 1 time. Last update was at by tarun k navlani
-arun
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
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................