Why java is not a pure object oriented language ?
What are the qualities of the object oriented language ?
Encapsulation
Abstraction
Inheritance
Polymorphism
All predefined types are objects
All user defined types are objects
All operations performed on the objects must be only through methods exposed at the objects.
Why java is not a pure object oriented language ?
Primitive Data Types
For a pure object oriented programming language , data should be represented in the form of objects only.
But java supports 8 primitive data types such as byte , short,int,long,float ,double. -> and because of this java is not considered
Size of primitive data types in java is fixed and is platform independent
Pure object oriented programming language.
Static Keyword :
- Creating variables and methods with static keyword can be accessed with just class name that is breaking the law of OOPS As the law states that we should access anything using an object in OOPS
Wrapper Classes
Even though java has wrapper classes we cannot say it is Pure OOPs since internally wrapper classes uses
Autoboxing and autounboxing that uses primitive types