Pure Object-Oriented Language or Complete Object-Oriented Language is a completely object-oriented language that supports or has the characteristic of treating everything inside the program as an object. It does not support primitive data types (such as int, char, float, bool, etc.). A pure object-oriented programming language needs to satisfy seven qualities. they are:
Why Java is not a Pure Object-Oriented Language?
Java supports attributes 1, 2, 3, 4, and 6, but does not support attributes 5 and 7 given above. The Java language is not a pure object-oriented language because it contains the following properties:
int a = 5; System.out.print(a);
String s1 = "ABC" + "A" ;
The use of wrapper classes also doesn't make Java a pure OOP language, as operations like unboxing and autoboxing are used internally. So if you create an integer instead of an int and do some calculations, under the hood Java only uses the primitive type int.
public class BoxingExample { public static void main(String[] args) { Integer i = new Integer(10); Integer j = new Integer(20); Integer k = new Integer(i.intValue() + j.intValue()); System.out.println("Output: "+ k); } }
In the above code, there are 2 problems where Java fails to work as pure OOP:
Australia
UK
UAE
Singapore
Canada
New
Zealand
Malaysia
USA
India
South
Africa
Ireland
Saudi
Arab
Qatar
Kuwait
Hongkong
Copyright 2016-2023 www.programmingshark.com - All Rights Reserved.
Disclaimer : Any type of help and guidance service given by us is just for reference purpose. We never ask any of our clients to submit our solution guide as it is, anywhere.