OOP Concepts

OOP concepts or object oriented programming concepts are the basics of understanding object oriented programming languages. If you know the basics, rest will be much easy to study. Talking about OOP concepts, there are four main OOP concepts that everyone must know.

  1. Inheritance
  2. Abstraction
  3. Encapsulation
  4. Polymorphism

Inheritance

Children inherit their most of the qualities and appearances from their parents. So do the classes you write. There are classes who likes to obtain some attributes and behaviors from other classes. This concept is called as inheritance. For example lets say you have class A and class B. Suppose you want to obtain attributes and behaviors of class A to B. So what you do is, simply write extend class A to class B. Here, class A is called as the super class and class B is called as the sub class. In Java you can only inherit one class by another class since the language does not support multiple inheritance.

class B extend class A

{

}