Open In App

Why Java is not a purely Object-Oriented Language?

Pure Object Oriented Language or Complete Object Oriented Language are Fully Object Oriented Language that supports or have features that treats everything inside the 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:

  1. Encapsulation/Data Hiding
  2. Inheritance
  3. Polymorphism
  4. Abstraction
  5. All predefined types are objects
  6. All user defined types are objects
  7. All operations performed on objects must be only through methods exposed at the objects.

Example: Smalltalk

Why Java is not a Pure Object Oriented Language?

Java supports properties 1, 2, 3, 4 and 6 but fails to support properties 5 and 7 given above. Java language is not a Pure Object Oriented Language as it contains these properties:

int a = 5; 
System.out.print(a);

String s1 = "ABC" + "A" ;




public class BoxingExample
{
    public static void main(String[] args)
    {
            Integer i = new Integer(10);
            Integer j = new Integer(20);
            Integer k = new Integer(i.intValue() + j.intValue());
            System.out.println("Output: "+ k);
    }
}

Related Article: Why C++ is partially Object Oriented Language? If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.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.

Article Tags :