OOPS CONCEPT IN JAVA

LEELA S
1 min readMar 15, 2022

--

OOps stands for Object Oriented Programming Language which provides the features of Class, Object, Encapsulation, Inheritance, Polymorphism, Abstraction.

1)Class

  • Class is a Collection of object
  • Class is a container, it contains both data members(variables) and member function(functions)
  • Class is a logical representation used to create an object
  • Memory is not allocated at the time of class declaration

Example

  • Paper Plan

2)Object

  • Any entity that has state and behavior is known as an object
  • Object is a collection of instance variable and methods
  • To access the class members, we have to define the object
  • Memory is allocated at the time of object creation
  • It is the pysical representation of class

Example

  • Building, Table, Chair, pen

3)Encapsulation

  • Wrapping of data members and member function in a single unit is called Encapsulation

Example

  • Capsule is mixed of several medicines

4)Data Abstraction

  • Displays only essential information to the user and hides the backend process

Example

  • Phone - By using phone, we can make a call,take pictures, send mails but we don’t know how it’s done the process

5)Polymorphism

  • Ability to have more than one forms

Example

  • A person can have many characteristics - A girl can be both Student as well as employee

6)Inheritance

  • Acquiring the property of new class from existing class
  • It follows two concepts - Reusability & Extensibility
  • Reusability - Use of old class in new class
  • Extensibility - Adding new features to the existing class

Example

  • We inherit the traits of our parents

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

LEELA S
LEELA S

No responses yet

Write a response