Is java pure or 100% oop programming language?
We all learn that java supports Object Oriented Programming (OOP) features.
But then all of a sudden in interviews, interviewer fires a question -
"Is java pure oop langauge?", or
"Is java 100% oop programing?"
And this may put you in confusion.
So to avoid any confusion at that time lets prepare for such questions beforehand.
Most of us are aware that java supports object oriented programming. But if we dive deeper into oop rule books, we will find that java is not a pure OOP language. As it supports primitive data types as well like int, double, float, long, etc. which is in contrast to the OOP that deals particularly in objects only.
Example of pure OOP
A pure OOP must satisfy all of these:
every user-defined type must be object,
all operations performed on the objects must take place through methods exposed as object.
Which oop rule does java violates?
Java violates the last two rules (marked in red) of OOP.
In java, pre-defined types such as primitive types are non-objects.
Apart from this a class declared as static does not require to be instantiated at all for calling it.
Thus we can conclude java is not pure oop.
Would you like to see your article here on tutorialsinhand.
program by tutorialsinhand.com
About the Author
I am editor in chief at tutorialsinhand.com responsible for managing, reviewing and sending articles/contents for final approval to get published. Connect with me@https://www.linkedin.com/in/sonu-pandit-a77b471ab/. Join write4us program & share your skill
Page Views :
Published Date :