Object Oriented ProgrammingSince Java is an object oriented programming language it has following features:
• Reusability of Code
• Emphasis on data rather than procedure
• Data is hidden and cannot be accessed by external functions
• New data and functions can be easily added Java has powerful features.
The following are some of them:-
* Portable (Platform Independent)
* High Performance
Object Oriented Programming is a method of implementation in which programs are organized as cooperative collection of objects, each of which represents an instance of a class, and whose classes are all members of a hierarchy of classes united via inheritance relationships.
OOPS ConceptsFour principles of Object Oriented Programming are:
Abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provide crisply defined conceptual boundaries, relative to the perspective of the viewer.
Encapsulation is the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior ; encapsulation serves to separate the contractual interface of an abstraction and its implementation.
* Hides the implementation details of a class.
* Makes the code more maintainable.
Inheritance is the process by which one object acquires the properties of another object.
Polymorphism is the existence of the classes or methods in different forms or single name denoting different implementations.