Pure Object Oriented Language or Complete Object Oriented Language are Fully Object Oriented Language which supports or have features which treats everything inside program as objects. It doesn’t support primitive datatype(like int, char, float, bool, etc.). There are seven qualities to be satisfied for a programming language to be pure Object Oriented. They are:
- Encapsulation/Data Hiding
- All predefined types are objects
- All user defined types are objects
- All operations performed on objects must be only through methods exposed at the objects.
Why Java is not a Pure Object Oriented Language?
Java supports property 1, 2, 3, 4 and 6 but fails to support property 5 and 7 given above. Java language is not a Pure Object Oriented Language as it contain these properties:
- Primitive Data Type ex. int, long, bool, float, char, etc as Objects: Smalltalk is a “pure” object-oriented programming language unlike Java and C++ as there is no difference between values which are objects and values which are primitive types. In Smalltalk, primitive values such as integers, booleans and characters are also objects.
In Java, we have predefined types as non-objects (primitive types).
int a = 5; System.out.print(a);
- The static keyword: When we declares a class as static then it can be used without the use of an object in Java. If we are using static function or static variable then we can’t call that function or variable by using dot(.) or class object defying object oriented feature.
- Wrapper Class: Wrapper class provides the mechanism to convert primitive into object and object into primitive. In Java, you can use Integer, Float etc. instead of int, float etc. We can communicate with objects without calling their methods. ex. using arithmetic operators.
String s1 = "ABC" + "A" ;
Even using Wrapper classes does not make Java a pure OOP language, as internally it will use the operations like Unboxing and Autoboxing. So if you create instead of int Integer and do any mathematical operation on it, under the hoods Java is going to use primitive type int only.
Integer i =
Integer j =
Integer k =
Integer(i.intValue() + j.intValue());
In the above code, there are 2 problems where Java fails to work as pure OOP:
- While creating Integer class you are using primitive type “int” i.e. numbers 10, 20.
- While doing addition Java is using primitive type “int”.
Related Article: Why C++ is partially Object Oriented Language?
This article is contributed by Sangeet Anand. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Why Constructors are not inherited in Java?
- Why a Constructor can not be final, static or abstract in Java?
- Why to use char array over a string for storing passwords in Java?
- Why Kotlin will replace Java for Android App Development
- Why is Java 'write once and run anywhere'?
- Why can't static methods be abstract in Java?
- Why You Should Switch to Kotlin from Java to Develop Android Apps?
- Why Java Interfaces Cannot Have Constructor But Abstract Classes Can Have?
- Why non-static variable cannot be referenced from a static method in Java
- Disadvantages of Java Language
- The complete History of Java Programming Language
- Difference between Java and C language
- Why to Override equals(Object) and hashCode() method ?
- Why is Scanner skipping nextLine() after use of other next functions?
- Tips and Tricks for Competitive Programmers | Set 2 (Language to be used for Competitive Programming)
- NaN (Not a Number) in Java
- Check if email address valid or not in Java
- Check if URL is valid or not in Java
- BigInteger not() Method in Java
- Java Program to Check if two Arrays are Equal or not