chapter 5.pptx: drainage and irrigation engineering
Basic concept of object oriented programming
1. BASIC CONCEPTS OF OOPS
Presnted by:
Manojkumar
Information Technology
II-year
2. WHAT IS OBJECT ORIENTED
PROGRAMMING?
Collection of objects
It focus on data, not on the procedure
In oops most important thing is called object
Objects consist of attributes and methods
Manojkumar
3. BASIC CONCEPTS OF OOPS
Manojkumar
Basic
concepts
Abstraction Object Class Inheritance Polymorphism
5. OBJECTS
Object is an instance of class
Object are basic run-time entities in object oriented
programming
Example
Manojkumar
6. HOW TO DECLARE AN OBJECT?
Syntax:
class_name Object = new class_name();
Example:
student mark = new student();
student-class name
mark-object name
Manojkumar
7. CLASS
Class can be defined as an entity in which data and
functions are put together
Class concept is similar to the concept of structures
in C
Manojkumar
8. HOW TO DECLARE A CLASS?
Manojkumar
Class class_name
{
//variables
//methods
}
Class student
{
int marks,total;
void display();
}
Syntax Example
Inside the body of the class there are two keyword used
1.private
2.public
These are called access specifiers
10. INHERITANCE
obtaining the data members and methods from one class
to another class is known as inheritance.
Manojkumar
11. the class which is give data members and methods is
known as base or super or parent class.
The class which is taking the data members and methods
is known as sub or derived or child class.
Manojkumar
12. POLYMORPHISM
It take more than one form and refers to an
operation exhibiting different behaviors in different
situations
Manojkumar