2.java OOP Concepts
2.java OOP Concepts
OOPs Concepts
Concepts of Object Oriented Programming:
• Class
• Object
• Data abstraction
• Data hiding
• Encapsulation
• Inheritance
• Polymorphism
• Encapsulation, Abstraction, Inheritance and polymorphism are the
core concepts of OOP.,if any programming language follows these
concepts we can say it as Object Oriented Program.
Class & Objects
• Class
• In Java, class is a user defined datatype/pre defined data type type which
has its own member data and member methods.
• A blue print/template to create objects
• Ex: Car, Student ,Animal..etc.
• Objects
• Object is a Instance of class
• Anything which has a state(data) and behavior(function),we can say its an
object.
• Ex: Ford, Arun, dog.
Class & Objects
• Class
• In Java, class is a user defined data type which has its own member data
and member methods.
• A blue print/template to create objects
• Ex: Car, Student ,Animal..etc.
• Objects
• Object is a Instance of class
• Anything which has a state(data) and behavior(function),we can say its an
object.
• Ex: Ford, Arun, dog.
Example 3: Class and Object
• Class Stundent
• Object ajay
o Member data regno,name,phy,che,bio,math,total,avg
o Member methods get(),calculate(),display()