Core Java SQL Oracle PHP Examples JSP JDBC MORE

Java oops Concept


oops:

OOPS concepts in Java are the main ideas behind Java's Object Oriented Programming. They are abstraction, encapsulation, inheritance, and polymorphism.

List of OOP Concepts in Java:

The four main OOP concepts in Java that are commonly used in java programing. these are:

  1. Abstraction.
  2. Encapsulation.
  3. Inheritance.
  4. Polymorphism.
  5. Data hiding.

Abstraction:

Hide internal implementation and just highlet the set of services that is the concept of abstraction.

advantage:

  1. Out side Person Can,t aware of our internal implementation .we can get security.
  2. Enhancement can be easy.
  3. improve easyness system.

Encapsulation:

Process of binding data and correspondence behaviour in a single unit.

Data member + Behavior(methods) = Encapsulation.

advantage:

  1. The main advantage of encapsulation we can achive security.
  2. Enhancement can be easy.
  3. It improve mentainability of application.

Inheritance:

Inheritance is an important feature of OOP(Object Oriented Programming). It is the mechanism in java by which one Parent class is allow to inherit the behaviours and methods of child class or sub class.

advantage:

Syntax:

class child class extends parent class
{
//behaviours and methods
}

Polymorphism:

Polymorphism is the concept that variety types of objects may be able to work in a difeerent way in given situation.

In java, method overloading and method overriding are two properties they use polymorphism.