Why Java is not purely Object-oriented programming language?
Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Fully Object-Oriented Languages that support or have features that treat everything inside a program as objects are known as Pure Object-Oriented Languages or Complete Object-Oriented Languages. It isn’t compatible with primitive data types (like int, char, float, bool, etc.).
Here are seven qualities to be satisfied for a programming language to be pure Object Oriented They are:
1. Abstraction
2. Inheritance
3. Encapsulation/Data Hiding
4. Polymorphism
5. All user-defined types are objects
6. All predefined types are objects
7. All operations performed on objects must be only through methods exposed to the objects.
Java supports 1, 2, 3, 4, and 6th points but java doesn’t support the 5th and 7th points given above. Java language is not a Pure Object-Oriented Language as it contains these properties:
Primitive Data Type ex. int, long, bool, float, char, etc as Objects
In Smalltalk, primitive values such as integers, booleans and characters are also objects. Smalltalk is a “pure” object-oriented programming language unlike Java and C++ as there is no difference between values that are objects and values which are primitive types.
Predefined types as non-objects (primitive types) in Java.
Because it supports primitive data types such as it, byte, long, and so on, Java is not totally object oriented. Because we employ data types like int, float, double, and others in JAVA that are not object oriented, which is the opposite of OOPs concept. So, JAVA isn’t completely object-oriented.
Answer: Java is not 100% Object-oriented programming language, Because in Java there is no interfaces like OOP which many people think that is one of the key feature of OOP. Because it supports primitive data types such as it, byte, long, and so on, Java is not fully object oriented. Because we use data types like int, float, double, and others in JAVA that are not object oriented, which is the polar opposite of OOP. That’s why JAVA isn’t completely object-oriented.
Java is “Java is not an Object-oriented language” and “Java is Object-oriented language” are two different things. You may ask why?
Why Java is not ‘object-oriented’
“In object-oriented programming, classes are used for defining their own state. This is achieved by using interface notation.” Java is not an ‘object-oriented’ language. You may call it ‘functional’, ‘functional’ or ‘dynamic’ language. Java uses a language that was designed for ‘functional’ programming.
Java is completely different from C, C++, OOP, OO, K-OS, and all the other ‘OO’ (Object Oriented) programming languages out there. You may consider it as ‘Dynamically typed’ language as it has quite a few dynamic features.