SlideShare a Scribd company logo
OBJECT ORIENTED PROGRAMING
{OOP}
BY SANGA G,
OOP ITRODUCTION
• What is object oriented programming?
Object-oriented programming (OOP) is a way to
organize and conceptualize a program as a set
of interacting objects.
• The programmer defines the types of objects
that will exist.
• The programmer creates object instances as
they are needed.
OOP CONT………….
• The programmer specifies how these various
object will communicate and interact with each
other.
• Object-oriented programming is a methodology
that gives programmers tools to make this
modeling process easier.
• Simply we can say Object-oriented
programming, or OOP, is an approach to problem
solving where all computations are carried out
using objects.
TEMINOLOGIES USED IN OOP
• Object
• Class
• Instance
• Inheritance
• Encapsulation
• Abstraction
• Polymorphism
• Overloading
Object
• An object is a component of a program that
knows how to perform certain actions and
how to interact with other elements of the
program.
• An object contains both data and methods
that manipulate that data
– An object is active, not passive; (it does things)
– An object is responsible for its own data
Object
• Code in object-oriented programming is organized
around objects. Once you have your objects, they can
interact with each other to make something happen
• Let's say you want to have a program where a person
gets into a car and drives it from A to B. You would
start by describing the objects, such as a person and
car. That includes methods: a person knows how to
drive a car and a car knows what it is like to be driven.
Once you have your objects, you bring them together
so the person can get into the car and drive.
Class
• A class is a blueprint or template or set of
instructions to build a specific type of object.
or
• class is the generic definition for a set of
similar objects
• A class can be thought of as a template used
to create a set of objects.
• A class is a static definition; a piece of code
written in a programming language
Class
• So, let's say you want to use a person in your
program. You want to be able to describe the
person and have the person do something. A
class called 'person' would provide a blueprint
for what a person looks like and what a person
can do. To actually use a person in your
program you need to create an object. You use
the person class to create an object of the
type 'person.' Now you can describe this
person and have it do something.
Class
A class is a statement
class ClassVariable
attr
AttrName1
:
AttrNameN
meth Pattern1 Statement end
:
meth PatternN Statement end
end
Instance
• An instance is a realization of a particular item of a class. In
other words, an instance is an instantiation of a class. All
the instances of a class have similar properties, as
described in the class definition. For example, you can
define a class called "Student" and create three instances
of the class "Student" for "Peter", "Paul" and "Pauline".
• The term "object" usually refers to instance. But it is often
used loosely, and may refer to a class or an instance.
• instance is a concrete occurrence of any object, existing
usually during the runtime of a computer program
Example of instance
For examples, suppose that we have a class called Circle, we can create
instances of Circle as follows:
// Declare 3 instances of the class Circle, c1, c2, and c3
Circle c1, c2, c3; // They hold a special value called null
// Construct the instances via new operator
c1 = new Circle();
c2 = new Circle(2.0);
c3 = new Circle(3.0, "red");
// You can Declare and Construct in the same statement Circle
c4 = new Circle();
Inheritance
• Inheritance
• Inheritance is the process of forming a new
class from an existing class that is from the
existing class called as base class, new class is
formed called as derived class.
• This is a very important concept of object-
oriented programming since this feature helps
to reduce the code size.
Example
// A class to display the attributes of the vehicle
class Vehicle {
String color;
int speed;
int size;
void attributes() {
System.out.println("Color : " + color);
System.out.println("Speed : " + speed);
System.out.println("Size : " + size);
}
}
// A subclass which extends for vehicle class
Car extends Vehicle {
int CC;
int gears;
void attributescar() {
Example cont……
// The subclass refers to the members of the superclass
System.out.println("Color of Car : " + color);
System.out.println("Speed of Car : " + speed);
System.out.println("Size of Car : " + size);
System.out.println("CC of Car : " + CC);
System.out.println("No of gears of Car : " + gears);
}
}
public class Test {
public static void main(String args[]) {
Car b1 = new Car();
b1.color = "Blue";
b1.speed = 200 ;
b1.size = 22;
b1.CC = 1000;
b1.gears = 5;
b1.attributescar();
}
}
Encapsulation
• Encapsulation is placing the data and the
functions that work on that data in the same
place. While working with procedural
languages, it is not always clear which
functions work on which variables but object-
oriented programming provides you
framework to place the data and the relevant
functions together in the same object.
Benefits of Encapsulation
• Makes it easy to model real-world entities –
hence easy to understand and maintain
• Control the way data is accessed or modified
• Makes the class easy to use for clients
• Increase reusability
• Aids to the flexibility of design e.g. It is
possible to add accelerationConfiguration field
in the Car. This will enable you to have
different acceleration behaviour of each car.
Abstraction
• Polymorphism is the capability of a method to
do different things based on the object that it
is acting upon. In other words, polymorphism
allows you define one interface and have
multiple implementations
Overloading
• Overloading is ability of one function to
perform different tasks, i.e,it allows creating
several methods with the same name which
differ from each other in the type of the input
and the output of the function.
Private and public
• Public, means all the class members declared under public will be
available to everyone. The data members and member functions
declared public can be accessed by other classes too. Hence there
are chances that they might change them. So the key members
must not be declared public.
example
class PublicAccess
{
public:
// public access specifier
int x;
// Data Member Declaration
void display();
// Member Function decaration
}
Private
• Private , means that no one can access the
class members declared private outside that
class. If someone tries to access the private
member, they will get a compile time error. By
default class variables and member functions
are private.
object oriented programing lecture 1
Methods and properties of the class
• A method in object-oriented programming
(OOP) is a procedure associated with a
message and an object. An object is made up
of data and behavior, which form the interface
that an object presents to the outside world.
Data is represented as properties of the object
and behavior as methods. For example, a
Window object would have methods such as
open and close, while its state (whether it is
opened or closed) would be a property.
Class methods
• Class methods are methods that are called on
a class rather than an instance. They are
typically used as part of an object meta-
model. I.e, for each class defined an instance
of the class object in the meta-model is
created.
property
• property is a member of a class that plays an
intermediary role to a field of the class. For example, if
you have a field of class and that member represents
the salary of an employee, a property can be the
"door" that other classes that need the salary must
present their requests to. As such, these external
classes cannot just change the salary or retrieve it as
they wish. A property can be used to validate their
request, to reject or to accept them.
• A property is used to "filter" access to a field of a class.
Therefore, you start by declaring a (private (if you don't
make it private, you may be deceiving the purpose of
creating a property)) field
property
• A property is used to "filter" access to a field
of a class. Therefore, you start by declaring a
(private (if you don't make it private, you may
be deceiving the purpose of creating a
property)) field
• https://www3.ntu.edu.sg/home/ehchua/prog
ramming/java/J3a_OOPBasics.html
• https://processing.org/examples/inheritance.
html
• https://www.tutorialspoint.com/cplusplus/cp
p_data_encapsulation.htm

More Related Content

What's hot (20)

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
dheva B
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Nilesh Dalvi
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
Bhavik Vashi
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
Chandrakiran Satdeve
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
Abhigyan Singh Yadav
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
Naresh Chintalcheru
 
Member Function in C++
Member Function in C++ Member Function in C++
Member Function in C++
NikitaKaur10
 
Concept of OOPS with real life examples
Concept of OOPS with real life examplesConcept of OOPS with real life examples
Concept of OOPS with real life examples
Neha Sharma
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
baabtra.com - No. 1 supplier of quality freshers
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
Vibhawa Nirmal
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Files in C
Files in CFiles in C
Files in C
Prabu U
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
Githushan Gengaparam
 
Inheritance C#
Inheritance C#Inheritance C#
Inheritance C#
Raghuveer Guthikonda
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
Oops ppt
Oops pptOops ppt
Oops ppt
abhayjuneja
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
dheva B
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Nilesh Dalvi
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
Bhavik Vashi
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
Abhigyan Singh Yadav
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
Naresh Chintalcheru
 
Member Function in C++
Member Function in C++ Member Function in C++
Member Function in C++
NikitaKaur10
 
Concept of OOPS with real life examples
Concept of OOPS with real life examplesConcept of OOPS with real life examples
Concept of OOPS with real life examples
Neha Sharma
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
Vibhawa Nirmal
 
OOPS In JAVA.pptx
OOPS In JAVA.pptxOOPS In JAVA.pptx
OOPS In JAVA.pptx
Sachin33417
 
Files in C
Files in CFiles in C
Files in C
Prabu U
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 

Viewers also liked (20)

Object Oriented Programing - Intro
Object Oriented Programing - IntroObject Oriented Programing - Intro
Object Oriented Programing - Intro
Bayu Firmawan Paoh
 
Mofolojia ya kiswahili
Mofolojia ya kiswahiliMofolojia ya kiswahili
Mofolojia ya kiswahili
Geophery sanga
 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choice
Soren
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 
Ge 249 SOPHISTS GROUP SAUT BUKOBA
Ge 249 SOPHISTS GROUP SAUT BUKOBA Ge 249 SOPHISTS GROUP SAUT BUKOBA
Ge 249 SOPHISTS GROUP SAUT BUKOBA
Mwl. Mapesa Nestory
 
Uchumi wa kibiblia
Uchumi wa kibibliaUchumi wa kibiblia
Uchumi wa kibiblia
001111111111
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
246paa
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
Mudasir Qazi
 
OOPS features using Objective C
OOPS features using Objective COOPS features using Objective C
OOPS features using Objective C
Tiyasi Acharya
 
Dynamics Telephony Dialer Intro
Dynamics Telephony Dialer IntroDynamics Telephony Dialer Intro
Dynamics Telephony Dialer Intro
Eddie Steede
 
Object Oriented Programing - Inheritance
Object Oriented Programing - InheritanceObject Oriented Programing - Inheritance
Object Oriented Programing - Inheritance
Bayu Firmawan Paoh
 
Object Oriented Programing - Polymrphism
Object Oriented Programing - PolymrphismObject Oriented Programing - Polymrphism
Object Oriented Programing - Polymrphism
Bayu Firmawan Paoh
 
Water resources management river basin manage
Water resources management river basin manageWater resources management river basin manage
Water resources management river basin manage
Mwl. Mapesa Nestory
 
Futuristic programing language
Futuristic programing languageFuturistic programing language
Futuristic programing language
Mohamed Zaki
 
Aspect Oriented Programing - Introduction
Aspect Oriented Programing - IntroductionAspect Oriented Programing - Introduction
Aspect Oriented Programing - Introduction
Venkaiah Chowdary Koneru
 
Fursa kwa walio na mtaji mdogo
Fursa kwa walio na mtaji mdogoFursa kwa walio na mtaji mdogo
Fursa kwa walio na mtaji mdogo
YSDO and MAP
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
Akshay Mathur
 
Jipime Sayansi Darasa la Sita
Jipime Sayansi Darasa la SitaJipime Sayansi Darasa la Sita
Jipime Sayansi Darasa la Sita
kanguni
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
baabtra.com - No. 1 supplier of quality freshers
 
Object Oriented Programing - Intro
Object Oriented Programing - IntroObject Oriented Programing - Intro
Object Oriented Programing - Intro
Bayu Firmawan Paoh
 
Mofolojia ya kiswahili
Mofolojia ya kiswahiliMofolojia ya kiswahili
Mofolojia ya kiswahili
Geophery sanga
 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choice
Soren
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Jay Patel
 
Ge 249 SOPHISTS GROUP SAUT BUKOBA
Ge 249 SOPHISTS GROUP SAUT BUKOBA Ge 249 SOPHISTS GROUP SAUT BUKOBA
Ge 249 SOPHISTS GROUP SAUT BUKOBA
Mwl. Mapesa Nestory
 
Uchumi wa kibiblia
Uchumi wa kibibliaUchumi wa kibiblia
Uchumi wa kibiblia
001111111111
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
246paa
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
Mudasir Qazi
 
OOPS features using Objective C
OOPS features using Objective COOPS features using Objective C
OOPS features using Objective C
Tiyasi Acharya
 
Dynamics Telephony Dialer Intro
Dynamics Telephony Dialer IntroDynamics Telephony Dialer Intro
Dynamics Telephony Dialer Intro
Eddie Steede
 
Object Oriented Programing - Inheritance
Object Oriented Programing - InheritanceObject Oriented Programing - Inheritance
Object Oriented Programing - Inheritance
Bayu Firmawan Paoh
 
Object Oriented Programing - Polymrphism
Object Oriented Programing - PolymrphismObject Oriented Programing - Polymrphism
Object Oriented Programing - Polymrphism
Bayu Firmawan Paoh
 
Water resources management river basin manage
Water resources management river basin manageWater resources management river basin manage
Water resources management river basin manage
Mwl. Mapesa Nestory
 
Futuristic programing language
Futuristic programing languageFuturistic programing language
Futuristic programing language
Mohamed Zaki
 
Fursa kwa walio na mtaji mdogo
Fursa kwa walio na mtaji mdogoFursa kwa walio na mtaji mdogo
Fursa kwa walio na mtaji mdogo
YSDO and MAP
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
Akshay Mathur
 
Jipime Sayansi Darasa la Sita
Jipime Sayansi Darasa la SitaJipime Sayansi Darasa la Sita
Jipime Sayansi Darasa la Sita
kanguni
 
Ad

Similar to object oriented programing lecture 1 (20)

OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
DurgaPrasadVasantati
 
OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
DurgaPrasadVasantati
 
4-OOPS.pptx
4-OOPS.pptx4-OOPS.pptx
4-OOPS.pptx
SatyamMishra237306
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
object oriented Programming ppt
object oriented Programming pptobject oriented Programming ppt
object oriented Programming ppt
Nitesh Dubey
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
java part 1 computer science.pptx
java part 1 computer science.pptxjava part 1 computer science.pptx
java part 1 computer science.pptx
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
PPT_Object Oriented Programming .pptx
PPT_Object Oriented Programming     .pptxPPT_Object Oriented Programming     .pptx
PPT_Object Oriented Programming .pptx
MDFARHAN3070
 
PPT_Object Oriented Programming (2).pptx
PPT_Object Oriented Programming (2).pptxPPT_Object Oriented Programming (2).pptx
PPT_Object Oriented Programming (2).pptx
faizus786
 
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTSOOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
RajendraKumarRajouri1
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPUUNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Introduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.pptIntroduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.ppt
IKATrainingCentre
 
Object -oriented analysis and design.ppt
Object -oriented analysis and design.pptObject -oriented analysis and design.ppt
Object -oriented analysis and design.ppt
pierrerj05
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
BG Java EE Course
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
KabitaParajuli3
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
object oriented Programming ppt
object oriented Programming pptobject oriented Programming ppt
object oriented Programming ppt
Nitesh Dubey
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
PPT_Object Oriented Programming .pptx
PPT_Object Oriented Programming     .pptxPPT_Object Oriented Programming     .pptx
PPT_Object Oriented Programming .pptx
MDFARHAN3070
 
PPT_Object Oriented Programming (2).pptx
PPT_Object Oriented Programming (2).pptxPPT_Object Oriented Programming (2).pptx
PPT_Object Oriented Programming (2).pptx
faizus786
 
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTSOOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
RajendraKumarRajouri1
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPUUNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Introduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.pptIntroduction to Object Oriented Programming.2.ppt
Introduction to Object Oriented Programming.2.ppt
IKATrainingCentre
 
Object -oriented analysis and design.ppt
Object -oriented analysis and design.pptObject -oriented analysis and design.ppt
Object -oriented analysis and design.ppt
pierrerj05
 
Ad

Recently uploaded (20)

THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 

object oriented programing lecture 1

  • 2. OOP ITRODUCTION • What is object oriented programming? Object-oriented programming (OOP) is a way to organize and conceptualize a program as a set of interacting objects. • The programmer defines the types of objects that will exist. • The programmer creates object instances as they are needed.
  • 3. OOP CONT…………. • The programmer specifies how these various object will communicate and interact with each other. • Object-oriented programming is a methodology that gives programmers tools to make this modeling process easier. • Simply we can say Object-oriented programming, or OOP, is an approach to problem solving where all computations are carried out using objects.
  • 4. TEMINOLOGIES USED IN OOP • Object • Class • Instance • Inheritance • Encapsulation • Abstraction • Polymorphism • Overloading
  • 5. Object • An object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program. • An object contains both data and methods that manipulate that data – An object is active, not passive; (it does things) – An object is responsible for its own data
  • 6. Object • Code in object-oriented programming is organized around objects. Once you have your objects, they can interact with each other to make something happen • Let's say you want to have a program where a person gets into a car and drives it from A to B. You would start by describing the objects, such as a person and car. That includes methods: a person knows how to drive a car and a car knows what it is like to be driven. Once you have your objects, you bring them together so the person can get into the car and drive.
  • 7. Class • A class is a blueprint or template or set of instructions to build a specific type of object. or • class is the generic definition for a set of similar objects • A class can be thought of as a template used to create a set of objects. • A class is a static definition; a piece of code written in a programming language
  • 8. Class • So, let's say you want to use a person in your program. You want to be able to describe the person and have the person do something. A class called 'person' would provide a blueprint for what a person looks like and what a person can do. To actually use a person in your program you need to create an object. You use the person class to create an object of the type 'person.' Now you can describe this person and have it do something.
  • 9. Class A class is a statement class ClassVariable attr AttrName1 : AttrNameN meth Pattern1 Statement end : meth PatternN Statement end end
  • 10. Instance • An instance is a realization of a particular item of a class. In other words, an instance is an instantiation of a class. All the instances of a class have similar properties, as described in the class definition. For example, you can define a class called "Student" and create three instances of the class "Student" for "Peter", "Paul" and "Pauline". • The term "object" usually refers to instance. But it is often used loosely, and may refer to a class or an instance. • instance is a concrete occurrence of any object, existing usually during the runtime of a computer program
  • 11. Example of instance For examples, suppose that we have a class called Circle, we can create instances of Circle as follows: // Declare 3 instances of the class Circle, c1, c2, and c3 Circle c1, c2, c3; // They hold a special value called null // Construct the instances via new operator c1 = new Circle(); c2 = new Circle(2.0); c3 = new Circle(3.0, "red"); // You can Declare and Construct in the same statement Circle c4 = new Circle();
  • 12. Inheritance • Inheritance • Inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class. • This is a very important concept of object- oriented programming since this feature helps to reduce the code size.
  • 13. Example // A class to display the attributes of the vehicle class Vehicle { String color; int speed; int size; void attributes() { System.out.println("Color : " + color); System.out.println("Speed : " + speed); System.out.println("Size : " + size); } } // A subclass which extends for vehicle class Car extends Vehicle { int CC; int gears; void attributescar() {
  • 14. Example cont…… // The subclass refers to the members of the superclass System.out.println("Color of Car : " + color); System.out.println("Speed of Car : " + speed); System.out.println("Size of Car : " + size); System.out.println("CC of Car : " + CC); System.out.println("No of gears of Car : " + gears); } } public class Test { public static void main(String args[]) { Car b1 = new Car(); b1.color = "Blue"; b1.speed = 200 ; b1.size = 22; b1.CC = 1000; b1.gears = 5; b1.attributescar(); } }
  • 15. Encapsulation • Encapsulation is placing the data and the functions that work on that data in the same place. While working with procedural languages, it is not always clear which functions work on which variables but object- oriented programming provides you framework to place the data and the relevant functions together in the same object.
  • 16. Benefits of Encapsulation • Makes it easy to model real-world entities – hence easy to understand and maintain • Control the way data is accessed or modified • Makes the class easy to use for clients • Increase reusability • Aids to the flexibility of design e.g. It is possible to add accelerationConfiguration field in the Car. This will enable you to have different acceleration behaviour of each car.
  • 17. Abstraction • Polymorphism is the capability of a method to do different things based on the object that it is acting upon. In other words, polymorphism allows you define one interface and have multiple implementations
  • 18. Overloading • Overloading is ability of one function to perform different tasks, i.e,it allows creating several methods with the same name which differ from each other in the type of the input and the output of the function.
  • 19. Private and public • Public, means all the class members declared under public will be available to everyone. The data members and member functions declared public can be accessed by other classes too. Hence there are chances that they might change them. So the key members must not be declared public. example class PublicAccess { public: // public access specifier int x; // Data Member Declaration void display(); // Member Function decaration }
  • 20. Private • Private , means that no one can access the class members declared private outside that class. If someone tries to access the private member, they will get a compile time error. By default class variables and member functions are private.
  • 22. Methods and properties of the class • A method in object-oriented programming (OOP) is a procedure associated with a message and an object. An object is made up of data and behavior, which form the interface that an object presents to the outside world. Data is represented as properties of the object and behavior as methods. For example, a Window object would have methods such as open and close, while its state (whether it is opened or closed) would be a property.
  • 23. Class methods • Class methods are methods that are called on a class rather than an instance. They are typically used as part of an object meta- model. I.e, for each class defined an instance of the class object in the meta-model is created.
  • 24. property • property is a member of a class that plays an intermediary role to a field of the class. For example, if you have a field of class and that member represents the salary of an employee, a property can be the "door" that other classes that need the salary must present their requests to. As such, these external classes cannot just change the salary or retrieve it as they wish. A property can be used to validate their request, to reject or to accept them. • A property is used to "filter" access to a field of a class. Therefore, you start by declaring a (private (if you don't make it private, you may be deceiving the purpose of creating a property)) field
  • 25. property • A property is used to "filter" access to a field of a class. Therefore, you start by declaring a (private (if you don't make it private, you may be deceiving the purpose of creating a property)) field

Editor's Notes

  • #12: Th
  • #14: Class Car  A has all the features of a vehicle. But it has its own attributes which makes it different from other subclasses.