I think java is pure object oriented, but in real it is not. But i dont know why java is not pure object oriented language, please help me to find out the reason.
Asked
Active
Viewed 1.5k times
13
-
What is your definition of pure object oriented? And why do you think Java is not? Any references? – RBaarda May 27 '11 at 11:21
-
1Have a look at a similar question here: http://stackoverflow.com/questions/974583/is-java-100-object-oriented – slothrop May 27 '11 at 11:21
-
And this is your second question that will be closed. You should think about it. – Peter Knego May 27 '11 at 11:23
-
2I support the close because it has been asked quite often at SO - but not the reason: it is a very real question. Please, close voters, take your time to find the duplicates, this helps the OP better then having a question downvoted and closed like this. – Andreas Dolk May 27 '11 at 12:04
-
Hence OOP language always deals with only objects that is, every thing should be object whereas in java we use primitive data type(int, float ) that are not objects, so java in not pure OOP but more OOP supported than C language. Hence concept of wrapper classed (Integer etc)has been introduced in Java to resolve these non-object data type. – Puneet Purohit Jan 04 '13 at 05:47
3 Answers
23
This is a homework question, right?
Primitive types, that's why. For instance try this:
int i = 42;
System.err.println(i.toString());

Rom1
- 3,167
- 2
- 22
- 39
-
2
-
Struggling to understand the significance of "This is a homework question, right?" – ChiefTwoPencils May 18 '15 at 01:19
3
The usual objection is that Java is not "purely" OO because it has primitive types (int, double, etc.), which are not objects.

JB Nizet
- 678,734
- 91
- 1,224
- 1,255
1
To make proof by contradiction: Java has int
, and int
, like all primitive types in Java, is not an Object
. There are possibly more reasons, though.

Waldheinz
- 10,399
- 3
- 31
- 61