Java Basic Oops Concept
-
Upload
atozknowledge-com -
Category
Education
-
view
356 -
download
1
description
Transcript of Java Basic Oops Concept
OOPS
[email protected] www.atozknowledge.com
OOPS
▪ Class
▪ Object
▪ Abstraction
▪ Inheritance
▪ Interface
▪ Encapsulation
▪ Polymorphism
Identity
State
Behavior
Class
▪ Class is logical entity
▪ Class contain set of objects or collection of objects
Objects
▪ Objects are real time entity
▪ Identify the object by its ▪ Identity
▪ State
▪ Behavior
atozknowledge.co
www.atozknowledge.com
Abstraction
▪ The general meaning for abstraction is ELIMINATION i.e fetching only the wanted information even though all information is available based on our need we are eliminating the unwanted information.
atozknowledge.co
www.atozknowledge.com
Inheritance
▪ When one Class extends another Class. Deriving new class from the existing class parent child relationship
Two types
▪ Single level
▪ Multi level
Cont..
Single level
Deriving a new class from the existing class(one to one)
Example
class A
{
}
class B extends class A
{
}
Cont..
Multi Level
Deriving multilevel of new class from the parent
Example
class A{
}
class B extends class A {
}
class C extends class B{
}
Interface
▪ Replacement of multiple inheritance that has methods and method definition and no implementation
Polymorphism
▪ The general meaning for POLY — many MORPHISM — behavior. Two types of polymorphism.
Encapsulation
▪ Encapsulation is a process of wrapping code and data together into a single unit e.g. capsule i.e mixed of several medicines.