Tutorials

Java Object Oriented Programming


OOP basics


Object oriented programming is a modern programming approach based on the fundamental concept of objects

Each object has its own attribute and behaviour. Its similar to human-beings where each one of us has unique name, age, look, etc. and different behaviour.

Other feaures like class, object, encapsulation, etc. moves around objects in OOP.

 

Object oriented programming provides lot of important concepts like:

  • Class→ A class is a template and object is an instance of that class. A class contains entire set of data and methods.
  • ObjectAn object is the basic component of OOP concept. Each object has a set of properties like name and behaviour that defines it uniquely. We will learn more in upcoming chapters.
  • Polymorphism→ Poly means many and morphism means forms. Using polymorphism, same metho can be invoked for different purposes. For example, a method perimeter can be used to find out the perimeter of square, rectangle, triangle, cube, etc.
  • Encapsulation→ Encapsulation means wrapping up of data and function into single unit.
  • Inheritance→ When one object acquires the property or characteristics of parent class it is termed as inheritance.
  • Abstraction→ When we hide the the internal details from outside world and reveal only the essential functionality, it is known as abstraction. 

Advantage of OOP 

  • OOP concept helps improve programming efficiency.
  • OOP enhances reusability. Example, class can be inherited or method can be called again and again.
  • OOP enhances security with concepts like encapsulation and abstraction.
  • OOP concepts reduces effort of software design.

Example of OOP 

  • Simula
  • C++
  • Python
  • Java
  • Smalltalk


Please Share this page
Views : 804
Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!