Is Java a pure object-oriented programming language?
Object oriented programming (OOP) language uses an object-oriented programming technique that binds related data and functions into an object and encourages reuse of these objects within the same and other programs. Many languages are Object Oriented and there are seven qualities to be satisfied for a programming language to be pure Object Oriented. They are:
- Encapsulation/Data Hiding
- All predefined types are objects
- All operations are performed by sending messages to objects
- All user defined types are objects.
Java is pure object oriented or not?
There are lot of arguments around whether Java is purely object oriented or not. Java is not a pure OOP language due to two reasons:
The first reason is that the Object oriented programming language should only have objects whereas java contains 8 primitive data types like char, boolean, byte, short, int, long, float, double which are not objects. These primitive data types can be used without the use of any object. (Eg. int x=10; System.out.print(x.toString());)
The second reason related to the static keyword . In pure object oriented language ,we should access everything by message passing (through objects). But java contains static variables and methods which can be accessed directly without using objects. That means, when we declare a class as 'static' then it can be referenced without the use of an object.
Next : Why can't a Java class be declared as static?
- Is anger a sign of bipolar disorder
- What houses were the Hogwarts teachers in
- What is data modelling in case tools
- Have you ever known an actual misogynist
- Is Facebook Coin better than Bitcoin
- Was musolini an evil man like Hitler
- What are flashbulb memories
- What are the best forts of Rajasthan
- Does staying childish forever have any disadvantages
- Can you parachute on Mt Everest
- Will Ramaphosa fix South Africas corruption problems
- How can J develop interest in poetry
- How can I buy a Beretta pistol
- What are the inconveniences of subliminal messages
- Who won the IPL in 2011
- Why are homegrown cucumbers bitter