开发者

what makes java not pure object oriented language? [closed]

开发者 https://www.devze.com 2023-03-08 15:20 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its curr开发者_开发技巧ent form.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its curr开发者_开发技巧ent form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.


This is a homework question, right?

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

int i = 42;
System.err.println(i.toString());


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消