Java is purely object oriented programming language
Many people on internet say’s that Java is actually not a pure object oriented programming language. The following are the assumptions made by them.
Assumptions:
- Purely object oriented means it should contain only classes and objects and it should not contain primitive data types like int, float, char etc., since they are neither classes nor objects.
- In pure object oriented languages we should access everything through objects. But in Java, the static variables and methods can be accessed directly without using objects.
- Java does not contain multiple inheritance.
The above assumptions represent lack of knowledge in Java.
Why Java is purely object oriented Programming Language ?
- Java primitive data types are used inside the class and never been used outside the class. So they are part of class.
- Static variables and methods also written inside the class and you can access them from outside through classname only. So they are also part of class. And only one copy of them is created in the memory and shared by all the objects in order to reduce the memory utilization.
- Any pure object-oriented language should follow all the 5 features of OOPS :
1. Classes and Objects
2. Encapsulation
3. Abstraction
4. Inheritance
5. Polymorphism
Conclusion:
Since Java contains all the above 5 features of OOPS, it is purely object oriented programming language. We should not say it’s not purely object-oriented language just because it does not support multiple inheritance. Multiple inheritance is not the main feature of OOPS and its only the sub feature of inheritance.