why java is partially OOP language | How can we make java 100% pure OOP language

Object Oriented Programming

before we move on why java is partially OOP language first we need to know what is OPP or Object Oriented Programming Language.

What is 100% Object Oriented Programming Language?

 

Object Oriented Programming Language (OOP) is basically used programming paradigm. lets have a clear discussion about Object Oriented Programing Language .

In prior time programs are used to code and express step by step such as a list of instructions or statements, this kind of approach is commonly called structural or procedural. It was bit good and efficient enough to put down an easy and simple applications but in other hand it needs something more convenient because of growing complexity and size of the source code. Because of these major reasons Object Oriented Programing Language or in short OOP comes.

Object Oriented Programming

Object Oriented Programming language Solves any major problem and helps to interact with each other by creating objects.

An object can be anything by describing what it is and what it can do in short basically its functionality like any name, place, character name. The whole this is done by just writing a class, where you can define or declare it’s attributes and methods, quite like a template or a blueprint.

By creating object’s instance you can brink object to life, and then setting the attributes to define or declare it what to do. The epic and best thing about OOP is you can create multiple instances there is no limits means that you can create as many instances as you want without  implementing functions for each of them. Object Oriented Programming allows you to write code with none or minimal code duplication. This helps programs to keep organized and provides an easier working space.

 

why java is partially OOP language

Qualities of a pure OOP language

There are seven qualities for a programming language to be satisfied as to be pure Object Oriented. They are:

1. Encapsulation/Data Hiding

2. Inheritance

3. Polymorphism

4. Abstraction

5.All user-defined types are objects

6. All predefined types are objects

7. All operations are performed by sending messages to objects to communicate each other 

If look at these seven qualities, Java does satisfy and support only first 5 qualities of Object Oriented programming language but java does not support is number #6, this is main reason why java is partially OOP language.

in Java all predefined types basically are not objects, because you can define only primitive types, so what it means whatever pre-define types it should be, in form of objects (Primitive Data Type  : int, char, float etc).

so the fact is why java is partially OOP language or Why Java is not a pure OOP language, in java pre-define types are actually primitive types but they are not in the form of objects eventually. So as we know every pure Object Oriented Programming language treats everything inside program as object.

This means it also violates number #7 condition. That’s why Java is not 100% pure object-oriented language or in simple words this is why java is partially OOP language .

pure object oriented language example

Often Smalltalk is considered currently one of the purest and best Object-oriented languages and comparing it to Java, it will give you sufficient reasons supports all condition of being pure OOP. this is why smalltalk is pure object oriented

Why java is not a pure object oriented language?

So these are the following reason of Why Java is not a pure OOP language? or you can say why java is partially oop language.

Lots of people from developer and programing background ask “justify the statement java is a pure object oriented programming language” or “java is an object oriented programming language true or false , so here is the main reasons actually why java is partially oop language.

• Primitive data types are saved either directly in fields or on the stack rather than on the heap. This is the reason Java is not considered a pure 0bject programming language or this is why java is partially oop language.

• If we have to judge and classify in between “pure 0bject oriented” and” non-pure 0bject oriented”  so It would be better to discuss about “purity levels”. Smalltalk has a higher purity level as compare to Java. “Primitive types” in Smalltalk are actually treated as “Primitive Classes” and in Smalltalk, all “procedures” or “functions”  basically acts like messages.

so this is the reason why java is partially OOP language and why smalltalk is pure object oriented.

Also read : React JS is the future of programming language | Learn basic things of React

How can we make java 100% pure Object Oriented Programming

so now we know why java is partially OOP language, so the question is how can we make java 100% pure Object Oriented Programming, so its very simple as we not use primitive data type concept in java ,instead of it we can use the concept of wrapper class.

Basically wrapper class is a class and its objects wraps or simply contains the primitive data types. As soon as we create a wrapper class ,it stores primitive data types in field which it contains. So wrapper class actually coverts primitive data type into objects. So here some primitive data types and it’s corresponding wrapper class given as tabular form in bellow

Primitive Data Types Wrapper Class
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double
boolean Boolean

for more informative ideas you can check out this video as well

 

Related tags

why java is partially oop language, why java is partially oop language mcq, which language is 100% object oriented, pure object oriented language example, why smalltalk is pure object-oriented, why java is called purely object oriented language, java is pure oop language or not, java is not a pure object oriented language, why java is partially oop language, why java is called purely object oriented language, why java is partially oop language mcq, which language is 100 object oriented, justify the statement java is a pure object oriented programming language, pure object oriented language example, why smalltalk is pure object oriented, java is an object oriented programming language true or false, Why Java is not a pure OOP language?, Is Java 100% object oriented language?, Why Java is a pure object oriented language?, What language is 100 OOP?

 

Leave a Comment