Java Oop
Java Oop
What is OOPS?
Object-Oriented Programming System
(OOPs) is a programming concept that
works on the principles of abstraction,
encapsulation, inheritance, and
polymorphism. It allows users to create
objects they want and create methods to
handle those objects.
DevTown
@devtown.in
02
Advantages of OOPs
OOPs Concepts in Java offer easy to
understand and a clear modular structure
for programs.
Objects created for Object-Oriented
Programs can be reused in other
programs.
If the development and designing team
follow OOPS concepts, then they can better
design with minimum flaws in large
programs.
Every object exists independently.
DevTown
@devtown.in
03
Concepts in Java
Class
The class is one of the Basic concepts of
OOPs which is a group of similar entities. It is
only a logical component and not the
physical entity. Example, if you had a class
called “Expensive Cars” it could have objects
like Mercedes, BMW, Toyota,
DevTown
@devtown.in
04
Object
An object can be defined as an instance of
a class, and there can be multiple instances
of a class in a program. Example , chair,
bike, marker, pen, table, car, etc.
Inheritance
Inheritance is one of the Basic Concepts of
OOPs in which one object acquires the
properties and behaviors of the parent
object.
DevTown
@devtown.in
05
Polymorphism
The ability of a variable, object or function to
take on multiple forms. Example, in English,
the verb run has a different meaning if you
use it with a laptop.
Association
A relationship between two objects, which
defines the diversity between objects.
Example, many students can associate with
one teacher while one student can also
associate with multiple teachers.
DevTown
@devtown.in
06
Abstraction
An act of representing essential features
without including background details.
Example, while driving a car, you do not have
to be concerned with its internal working.
Encapsulation
Encapsulation is one of the best Java OOPs
concepts of wrapping the data and code.
Example – in school, a student cannot exist
without a class.
DevTown
@devtown.in
07
Aggregation
In this technique, all objects have their
separate lifecycle. Example consider
class/objects department and teacher.
Composition
Composition is a specialized form of
Aggregation. Child objects do not have their
lifecycle so when parent object deletes all
child object will also delete automatically.
DevTown
@devtown.in
KBC time!
overflow element?
A. scroll C. hidden
Live-Bootcamps
DevTown On our YouTube Channel:
@devtown.in DevTownIndia
Shaurya Sinha
Ashish Modi