+ 1

Java is pure Object Oriented or not?

I am confused that Java is pure Object Oriented or not? Because some says that even there is a primitive data type, java provide wrapper classes for them to make it object, so java is pure OO. But I think as there are primitive data types in java so Java is not pure Object Oriented. What is exact answer to this?

1st Aug 2017, 4:52 AM
Junaid Khan
Junaid Khan - avatar
4 Antworten
+ 3
In a purely object oriented language, everything is an object. Java has primitives. That makes it an impure object oriented language. The primitives do not extend the object every other type extends in some way. proof, if you like: System. out.println(42.toString()) in the jshell will make jshell unhappy. you can of course write whole program to test it and watch it fail to compile.
1st Aug 2017, 4:58 AM
Venkatesh Pitta
Venkatesh Pitta - avatar
0
Ya... Thanks venkatesh pitta
1st Aug 2017, 5:05 AM
Junaid Khan
Junaid Khan - avatar
0
It's pure object oriented, you have to put your code in a class while this is not requested in C++ or Python.
1st Aug 2017, 8:17 AM
Bàng Tứ Cường
Bàng Tứ Cường - avatar
1st Aug 2017, 9:07 AM
Junaid Khan
Junaid Khan - avatar