OOP's Mahesh
OOP's Mahesh
Engineering
-By Mahesh Joshi
III SEM CSE
3PD23CS402
OOP’S WITH
JAVA
Contents:
Object-Oriented Programming (OOP’s) concepts in Java helps reduce code complexity and enables
the reusability of code. Programmers feel like working with real-life entities or objects.
Object-oriented programming is a programming paradigm that brings together data and methods
in a single entity called object.
This promotes greater understanding as well as flexibility and maintenance of code over a long
period of time.
Introduction to OOP’s
Encapsulation
Genericity Abstraction
Message
OOP’s Inheritance
Passing
Multiple
Polymorphism
Inheritance
Interface
Classes & Objects
Classes -
A class in the context of Java is a template used to create objects and to define
object data types and methods. Classes are categories, and objects are items
within each category. All class objects should have the basic class properties.
Objects –
In the Java programming language, an object is an instance of a Java class,
meaning it is a copy of a specific class. Java objects have three primary
characteristics: identity, state, and behavior.
Classes & Objects
Class
Constructor
Objects Methods Datatypes
s
Exception Handling
Exception handling –
It is the process of responding to unwanted or unexpected events when a
computer program runs.
Exception handling deals with these events to avoid the program or
system crashing, and without this process, exceptions would disrupt the
normal operation of a program.
Main Features of OOP’s
Encapsulation in Java
Java, Inheritance is an
refers to integrating data In the Java programming
important pillar of
(variables) and code language, an interface
OOP(Object-Oriented
(methods) into a single is a reference type,
Programming). It is the
unit. In encapsulation, a similar to a class, that
mechanism in Java by
class's variables are can contain only
which one class is
hidden from other constants, method
allowed to inherit the
classes and can only be signatures, default
features(fields and
accessed by the methods, static methods,
methods) of another
methods of the class in and nested types.
class.
which they are found.
Inheritance
Inheritance
Class A
Class B
Multi-Level Inheritance
Class A
Class B
Class C
Multiple Inheritance
Class A
Class B Class C
THANK YOU