[go: up one dir, main page]

0% found this document useful (0 votes)
39 views4 pages

Java's Object-Oriented Paradox Why It's Not Purely OOP

In this paper authors trying to studies that Java is not strictly object-oriented, even though it is commonly considered an object-oriented programming (OOP) language

Uploaded by

IJMSRT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views4 pages

Java's Object-Oriented Paradox Why It's Not Purely OOP

In this paper authors trying to studies that Java is not strictly object-oriented, even though it is commonly considered an object-oriented programming (OOP) language

Uploaded by

IJMSRT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Volume -3,Issue-5,May2025 International Journal of Modern Science and Research Technology

ISSN NO-2584-2706

Java’s Object-Oriented Paradox: Why it’s not Purely OOP


Sandhya Dahake; Sahil Sheikh; Wilson Francis
Department of Master in Computer Application, G H Raisoni College of Engineering and Management
Nagpur, Maharashtra, India

Abstract: Although Java is promoted as an object-


In this paper authors trying to studies that Java oriented language, it has a number of features
is not strictly object-oriented, even though it is that depart from the fundamentalof OOP. Java
commonly considered an object-oriented is not entirely object-oriented, as seen by the
programming (OOP) language. Java contains usage of static methods, the existence of
primitive data types (char, double, int, etc.) that primitive data types (int, char, double, etc.),
are not part of the object model, but a pure and the support for procedural programming
OOP language considers everything as an features. Furthermore, unlike fully object-
object. Java also departs from rigid OOP oriented languages like Smalltalk or Ruby,
standards by supporting static methods and Java lacks operator overloading and does not
procedural programming. Features like support multiple inheritance through classes.
operator overloading and real multiple This study looks at what makes a pure object-
inheritance are absent from Java in contrast to oriented language, how Java deviates from
completely object-oriented languages like these standards, and why Java should be
Smalltalk. Because of these drawbacks, Java is categorized as a hybrid programming language
not strictly object-oriented but rather instead of a totally object-oriented one.
categorized as a hybrid language. These
features will be thoroughly examined in this 2. Background
paper, along with the reasons why Java does By grouping code into objects, the
not entirely adhere to the rules of pure object- programming paradigm known as object-
oriented programming. oriented programming (OOP) encourages
modularity, reusability, and maintainability.
Keywords: All data types and functions are treated as
Java, Object-Oriented Programming (OOP), objects in a totally object-oriented language,
Pure Object-Oriented Language, Primitive which rigorously adheres to the fundamental
Data Types, Procedural Programming. OOP concepts of abstraction, polymorphism,
inheritance, and encapsulation. The fact that
1. Introduction languages like Smalltalk and Ruby do not
Among the most widely used programming permit non-object elements makes them
languages, Java is renowned for its resilience, entirely object-oriented. Java was created as a
platform freedom, and strict adherence to high-level, platform-independent, and secure
object-oriented programming (OOP) concepts. programming language and was first released
Everything in a program should be represented by Sun Microsystems in 1995. It uses
as an object, according to the theory behind procedural programming components for
object-oriented programming, which supports flexibility and speed optimization, even if it
concepts like abstraction, polymorphism, adheres to OOP
inheritance, and encapsulation. But in a essential characteristics as a hybrid language
language that is entirely object-oriented, all that combines procedural and object-oriented
entities—including simple data types and programming ideas [5].
functions—must be regarded as objects.
In order to prove that Java is not a solely
object-oriented programming language, this
IJMSRT25 MAY043 www.ijmsrt.com 220
DOI: https://doi.org/10.5281/zenodo.15472828
Volume -3,Issue-5,May2025 International Journal of Modern Science and Research Technology
ISSN NO-2584-2706
paper examines Java's non-OOP features, Java permits static methods to be called
contrasts them with those of other without first generating an object, however in a
languages, and provides evidence. pure OOP language, all methods should be a
component of objects [1], [5].
4. Methodology class Example {
The reason Java is not a strictly object- static void showMessage(){
oriented programming language is examined System.out.println("This is a static method.");
in this research article using a theoretical and }
comparative analysis technique. The }
following are the main steps in the public class Main {
methodology: public static void main(String[] args) {
Example.showMessage();
4.1 Literature Review: }
A comprehensive analysis of scholarly }
works, books, and official Java This breaks the object-oriented approach since
documentation was done in order to showMessage() is not associated with an
comprehend the fundamentals of Object- instance of Example .
Oriented Programming (OOP) [2] and how
Java applies them [1], [4]. 4.2.4 OperatorOverloadinAndMultipleInanc
e:
4.2 DefiningPureObject-Oriented Java does not support operator overloading,
Characteristics: unlike C++. Also, Java does not allow multiple
Characteristics of a purely object-oriented inheritance through classes, only via interfaces
language were specified in order to create a [3].
clear evaluation framework. These consist of:
4.3 Comparative Analysis:
4.2.1 Everything must be an object: To identify differences, Java's characteristics
Even basic values like characters and were contrasted with those of strictly object-
numbers should be objects in a pure OOP oriented languages like Smalltalk and Ruby
language [3]. Nevertheless, Java contains [3]. Java's designation as a hybrid language
primitive data types that are not objects, was aided by this investigation [5].
like int, double, and char [6]. In java,
int x = 10; 4.4 Code-Based Evaluation:
In contrast, a pure OOP language like The following are some examples that were
Smalltalk treats everything, even numbers, as used to demonstrate Java's non-object-oriented
objects [3]. programming features:
 The existence of primitive data types (int,
4.2.2 No primitive data types: double, etc.) [6].
To wrap primitives as objects, Java has  The use of static methods and variables [1],
wrapper classes like Integer and Double; [5].
nevertheless, this is merely a workaround and  The ability to write procedural-style code
not a true OOP solution [4]. within the main() method [5].
Integer y = 20;  The absence of operator overloading and
Java still permits the direct use of primitive multiple inheritance through classes [1], [3].
types, though, which goes against the
fundamentals of OOP[6]. 4.5. Conclusion Based on Findings:
The evidence that was gathered was
4.2.3 No static methods or procedural reviewed to confirm that Java, despite being
programming constructs: heavily object-oriented, has aspects that are
not object-oriented, which prevents it from
IJMSRT25 MAY043 www.ijmsrt.com 221
DOI: https://doi.org/10.5281/zenodo.15472828
Volume -3,Issue-5,May2025 International Journal of Modern Science and Research Technology
ISSN NO-2584-2706
being classed as a language that is purely in In contrast to pure OOP languages, where all
the object-oriented category [5]. activities must take place through objects, no
objects are needed in order to print a message.
5. Result And Discussion
Java cannot be categorized as entirely object- 5.4 Lack of Operator Overloading:
oriented when its characteristics are Unlike C++ or Smalltalk, Java does not allow
compared to the requirements for a purely operators like +, -, *, etc. to be overloaded to
object-oriented language [3]. Java's design operate with custom objects [1], [3]. This
choices contain a number of non-object- lessens Java's commitment to true OOP and
oriented components that are more in line limits the expressiveness of objects [5].
with procedural programming, even though
the language strongly supports object- 5.5 No True Multiple Inheritance:
oriented programming concepts [5]. As a design tradeoff to prevent ambiguity, Java
only permits multiple inheritance through
5.1 Primitive Data Types: interfaces rather than classes [1]. Although this
The pure OOP tenet that everything should be method is effective, pure OOP systems like
an object is directly violated by Java's support Smalltalk permit multiple inheritance directly
for primitive types like int, char, double, and through classes, therefore it is not a completely
boolean [6]. Like, object-oriented feature [3].
int number=5;
In contrast, purely object-oriented languages 6. Conclusion
like Smalltalk represent even numbers as Although Java is frequently referred to as an
objects [3]. object-oriented language, a closer look reveals
that Java is not entirely object-oriented [5].
5.2 Static Methods and Variables: Everything, including basic data types and
Variables and methods can be specified as functions, must be handled as an object in a
static in Java, which means they belong to the language that is exclusively object-oriented.
class and not any instance of an object. The However, Java provides primitive data types that
object-oriented tenet that all behavior should are not part of the object paradigm, such as int,
belong to objects is broken by this procedural char, and double [6]. Additionally, it violates the
activity [1], [5]. For example: fundamental object-oriented tenet that behavior
class Utility { static void displayMessage() { should belong to objects by permitting static
System.out.println("Static method called"); methods to be called without first generating
} objects [1], [5].
} Java also doesn't have operator overloading
Here, displayMessage() can be called without [1], only allows multiple inheritance for
creating an object of Utility. interfaces [3], and supports procedural
programming with its main () function [5].
5.3 Procedural Programming Support: These characteristics, which combine
It is possible to write code in a totally procedural and object-oriented programming
procedural way, where no objects are created, techniques, are more in line with hybrid
using Java's main() function, which acts as the programming.
program entry point. Although this flexibility is These design decisions shift Java away from
useful, it goes against the idea of pure OOP [5]. being solely object-oriented even though they
For Example: improve simplicity and efficiency. In order to
public class Main { public static void meet the demands of real-world programming,
main(String[] args) { Java is best categorized as a hybrid language,
System.out.println("Hello, world!"); combining procedural freedom with object-
} oriented strength [5].
}
IJMSRT25 MAY043 www.ijmsrt.com 222
DOI: https://doi.org/10.5281/zenodo.15472828
Volume -3,Issue-5,May2025 International Journal of Modern Science and Research Technology
ISSN NO-2584-2706
7. References
[1] J. Gosling, B. Joy, G. Steele, G. Bracha, [8] Bloch, J. (2018). Effective Java, 3rd ed.
and A. Buckley, The Java Language Addison-Wesley.
Specification, Oracle, 2020. [Online]. [9] Gamma, E., Helm, R., Johnson, R., &
Available: Vlissides, J. (1994). Design Patterns:
https://docs.oracle.com/javase/specs/ Elements of Reusable Object-Oriented
[2] H. Schildt, Java: The Complete Software. Addison-Wesley.
Reference, 11th ed. New York: McGraw- [10] Oracle. (2024). "Java and Multiple
Hill Education, 2018. Inheritance: Design Choices and
[3] Kay, “The Early History of Smalltalk,” Limitations." [Online]. Available:
ACM SIGPLAN Notices, vol. 28, no. 3, pp. https://docs.oracle.com/javase/tutorial/java/I
69–95, Mar. 1993, doi: andI/multipleinheritance.html
10.1145/155360.155364. [11] Lee, K., & Anderson, P. (2019). "Static
[4] Oracle, Java Tutorials: Object-Oriented Methods and Procedural Programming in
Programming Concepts, 2024. [Online]. Java: An OOP Trade-off." Journal of
Available: Software Engineering Studies, vol. 15, no. 2,
https://docs.oracle.com/javase/tutorial/java/c pp. 45-58.
oncepts/ [12] "Why doesn't Java offer operator
[5] Smith, J. (2020). "Analyzing Object- overloading?" Stack Overflow, 2008.
Oriented and Procedural Features in Java." [Online].Available:
Proceedings of the International https://stackoverflow.com/questions/77718/
Conference on Software Engineering why-doesnt-java-offer-operator-overloading
(ICSE). [13] A. Obregon, "A Guide to Object-
[6] Miller, R., & Davis, L. (2018). Oriented Programming in Java," Medium,
"Primitive Data Types in Java: A Challenge 2023.[Online].Available:
to Object-Oriented Purity." IEEE https://medium.com/@AlexanderObregon/a-
Symposium on Programming Paradigms. guide-to-object-oriented-programming-in-
[7] Stroustrup, B. (2013). The C++ java-89dc4544837f
Programming Language, 4th ed. Addison-
Wesley.

IJMSRT25 MAY043 www.ijmsrt.com 223


DOI: https://doi.org/10.5281/zenodo.15472828

You might also like