Articles

Is java pure or 100% oop programming language?

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

  • Smalltalk,
  • Scala

A pure OOP must satisfy all of these:

  1. Polymorphism,
  2. Encapsulation,
  3. Inheritance,
  4. Abstraction,
  5. every user-defined type must be object,
  6. 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.


Java Interview Questions

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Sonu Pandit
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 : Aug 22,2020  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!