Is
java is pure object oriented language or not, java is pure object oriented
language why, why java is not pure object oriented programming language,
why java is not 100 object oriented
language, why java not 100 pure oop language, Is java is
100% pure Object Oriented Language, Why Java is not pure object oriented
language
Is java pure or 100% object oriented programming language or Not Why ?
This article about Whether java is 100% purely
object oriented language or not.
In most of the interview whether it would
be fresher, Experience of 2+, 3+, 4+, 5+, 6+ interviews. we can find this type of
question “Is Java is pure Object oriented programming language ? “ or We can
find the Question “ Why Java is not pure Java Object Oriented Programming
language ?”
Is Java is pure Object Oriented Programming Language? or
Why Java is not Pure Java Object Oriented
Programming Language?
No, Java is not 100% pure object Oriented language. Few Reasons that Supports java is not a pure object oriented programming
language.
Some of the Valid Reasons Why Java is not Pure Object Oriented language.
1) Primitive data Types in Java
2) Operator Overloading is not there
in java.
3) Multiple Inheritance is not
allowed in java.
Primitive Data Types in java :
Initially Primitive
data types like int, float, double etc… using these types we are representing
the data in java. That’s why everything is not represented in the form of object. So Java is not 100% pure Object oriented language. But We Can achieve this From the Java
version 5.0 inclusion of Wrapper class are there such as Integer, Float, Double
etc.. these are used to perform implicit numeric algorithms that can convert to
string by using toString(), by using Wrapper class we can perform numeric
operations.
Operator Overloading :
In java Operator Overloading is not supported, When
we operate on two Integer Objects, it always like to operate on actual integer
primitive types. The main difference in java that does not allow to operate on Integer,
int type directly. We need to override the intValue(), floatValue() methods to perform
the operations. Whatever C++ supports overloading of ‘+’, ‘-‘ operators to
apply on both object and primitive types. The main logic behind in java not
supports operator overloading is due automatic memory management that is
provided by JVM. Not similar to C++, Java supports automatic memory management,
which allows a daemon thread as garbage collector to work independently of the
JVM in dynamically for de allocation of memory space. The main Purpose or
reason that java does not support operator overloading to clean the memory
instantly in avoiding the potentials leaks, which is possibly occurs through
the use of operator overloading and pointers.
Multiple Inheritance :
Java Does not Supports Multiple Inheritance using classes, but we can achieve
it through Interface. If we concern interface we cannot create instance or
object for the Interface Directly.
Multiple Inheritance Using Interface
Object Oriented Programming Principles or OOP Principles
1) Class
2) Object
5) Inheritance
6) Polymorphism
No comments:
Post a Comment