Html & Html5

The World's best Software Development Study Portal

Java OOPs Concept

Object oriented programming is methodology where we design program using classes and objects.Java is an object oriented language. Being object oriented Java support following concept of OOPs:-

Pillars of OOPs:

  • Class
  • Object
  • Inheritance
  • Abstraction
  • Polymorphism
  • Encapsulation

Advantages of OOPs:

  1. Main advantage of Java is inheritance i.e you can reuse code.
  2. Provide security by data hiding.
  3. Divide large tasks into simple one.


Inheritance is property of an object to acquire all the properties and behaviour of its parent object.Inheritance represents parent-child relationship where parent class is also known as super class and child class is known as sub class.


  • Code reusability
  • Extensibility
  • Overriding
  • Data hiding


class Subclass extends Superclass { //methods }


Polymorphism is propert of an object which allows it to take multiple forms.

Compile time:-

is also known as Static polymorphism.It is resolved during compiler time.Overloading is an example of compile time polymorphism.

Rules for overloading

  1. It can throw different exception.
  2. It can have different access specifier.
  3. Overloaded method must have different arguement list.

Run time:-

is also known as Dynamic polymorphism.It is resolved during run time.Overriding is an example of run time polymorphism.An override method is call through reference variable of super class.


Abstraction is the methodology in which internal details hide from users,only necessary information provided to user.


It is process of wrapping up data and code into single unit.It's also known as data hiding because variables of class are hidden from other classes and can be accessed only through methods of their current class.