Overview of OOP in Java

Kandadi ManasaKandadi Manasa
3 min read

Classes, Objects and Methods

Scenario: Oka classroom "IT" lo "Teachers and Students" untaru, Manam class lo chese panlu:

  • Attendance

  • Sleep

  • Eat

Now, e scenario lo manam objects, methods and classes ni define chedham.

  • Objects: Teachers and Students

  • Methods: Attendance, sleep and eat

Class: Oka Closed Environment

To Define in Java these terms mean:

Objects are Instances of Class.

Class is an Main Entity.

Class that contain some characteristics and behaviors specified known as Methods.

Explaination: Class anedhi oka main entity or blue print, indulo manam objects ni define chestham, vatini instances antam because (oka class teacher oka class ki belong ainatu, similarly oka object ah class ki belong avthundi), and e objects ki some behaviour untadi vatini manam methods antam (taking attendance, teaching).

I Hope i have provided clear explaination😊, keep reading the entire article.


Inheritance

Niku anni mi nanna polikalu a... dini a inheritance antam!

Java lo oka class nunchi oka class inherit aithe manam dani inheritance antam.

Example:

Parent Class: CSE

Child Class: CSE-AIML, CSE-CS, CSE-DS vitini manam child classes antam anamata

Definition: When one class acquires all the properties and behaviors of a parent class, it is known as inheritance. It provides code reusability.


Encapsulation

Oka class ki belong aina objects inka methods anni ah particular class lo ne untai.

Manam IT ki belong ayi CSE lo poi kurchunte baita padestharu, mana class manade, so similarly ekada kuda same.

The Objects and Methods belonging to specific class are closed or encapuslated in it.

Definition: Binding (or wrapping) code and data together into a single unit are known as encapsulation.

Example: A capsule, it is wrapped with different medicines.


Polymorphism

Oka Friend ni chusi "Mastu Shades unai ra nilo" antam kadha, same to same in java oka Method oka oka circumstance lo oka oka laga behave chesthadi. dinini a manam polymorphism antam.

Definition: If one task is performed in different ways, it is known as polymorphism. For example: to convince the customer differently in a saree store.

poly -> many, morph -> shapes/shades.

In Java Polymorphism in implemented using methods, how one method can behave differently under various circumstances.


Abstraction

Hiding internal details and showing functionality is known as abstraction.

For example phone call, we don't know the internal processing.

General ga, roju motham reels scroll chestham, but avi akada nunchi ostunai, akada store avthunai, manaki insta avi ala provide chesthundo manaki telidhu, basically unnecessary details are hidden.


Miru e article tho basic terms ardam cheskunte, drop a like.

  • Classes

  • Objects

  • Methods

  • Inheritance

  • Encapsulation

  • Polymorphism

  • Abstraction

21
Subscribe to my newsletter

Read articles from Kandadi Manasa directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kandadi Manasa
Kandadi Manasa