13

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.

5
  • What is your definition of pure object oriented? And why do you think Java is not? Any references? Commented May 27, 2011 at 11:21
  • 1
    Have a look at a similar question here: stackoverflow.com/questions/974583/is-java-100-object-oriented Commented May 27, 2011 at 11:21
  • And this is your second question that will be closed. You should think about it. Commented May 27, 2011 at 11:23
  • 2
    I 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. Commented May 27, 2011 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. Commented Jan 4, 2013 at 5:47

3 Answers 3

23

This is a homework question, right?

Primitive types, that's why. For instance try this:

int i = 42;
System.err.println(i.toString());
Sign up to request clarification or add additional context in comments.

2 Comments

+1 because you gave an example
Struggling to understand the significance of "This is a homework question, right?"
3

The usual objection is that Java is not "purely" OO because it has primitive types (int, double, etc.), which are not objects.

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.