OOP Basic in Java | Object Oriented Programming

What is object-oriented programming (OOP)?

Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic.

An object can be defined as a data field that has unique attributes and behavior.

OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This approach to programming is well suited for software that is large, complex and actively updated or maintained. This includes programs for manufacturing and design, as well as mobile applications. For example, OOP can be used for manufacturing system simulation software.

Basic features of SPM

Example: C, Pascal, FORTRAN

Problems with Structured Programming Methodology (SPM)

The striking features of OOP

Concepts of OOP

01. Object

  1. Properties / State
  2. Method / Behavior (Functionalities)

Two characteristics of Object

  1. Properties / State 
  1. Method / Behavior (Functionalities)

Example

Object:            House

States:            Color and Location

Behaviors:   Close/open doors

02. Class

A class can be defined as a template/blueprint of an object that describes the behaviors/states that object.

Detailing Objects

Account:

Has : A/C Number, Balance, Opening Date, Account Holder details

Does: Deposit money, Withdraw money

Employee

Branch:

Has: Name, Location, No of accounts

Does: Create new accounts, make transaction

Employee:

Has: name, id, email, salary

Does: Handle banking transactions

Account Holder:

Has: name, contact
no, accounts

Does: Handle banking transactions

Basic concepts of OOP

Object

  1. Properties / State
  2. Method / Behavior (Functionalities)

Class

A class can be defined as a template/blueprint of an object that describes the behaviors/states that object.

Methods

Instance Variables

Each object has its unique set of instance variables

Such as, 

A Box can have Height, Width, Depth

These are the Instance variables of that box.

An object’s state is created by the values assigned to these instance variables.

Basic Features of OOP

Inheritance

Thank You!

Leave a Reply

Your email address will not be published. Required fields are marked *