So first lets list out the what are the different object oriented concepts in java:
- Class
- Object
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
- The language should be capable of implementing encapsulation feature.
- The language should be capable of implementing the inheritance feature.
- It should able to provide the feature of polymorphism.
- All types defined by users should be object. That means we can not define data types using primitive data types such as int, float, long etc.
- You must perform the operations by exchanging the messages between objects.
- The predefined types in language must be object.
Again in Java you have the option to declare the data types using Wrapper classes which means you can declare data types as object in Java. But thing is that for any language to be pure object oriented everything should be object. And in Java there are lot of things which are not pure objects.
So in my opinion Java is not pure object oriented language; though it implements most of the features of object oriented language. The few reasons why java is not pure or 100% object oriented language are:
- Though you have option to declare primitive data types as objects using Wrapper classes in java; you can declare them as primitive data types in java.
- Java does not support the feature of multiple inheritance using extends keyword.
- Sometimes you can perform some operations without using objects or without passing any message to object using "static methods"in java.
Object orientation is the way only to develop some applications using a programming language which is easy to code, easy to read and easy to understand. This easiness provided by splitting the problems in terms of objects and methods. Definitely Java has all the object oriented features but it lags when we talk about purr object orientation. So now you can say that Java is not pure object oriented language or java is not 100% object oriented.
0 comments:
Post a Comment