SlideShare a Scribd company logo
Object Oriented
Programming
Concepts
By:Apeksha Jadhav
Poornima
Ramya
Sanmati RM
Yashaswini S
TABLE OF CONTENTS
1. Introduction to OOPS
2. Characteristics of OOPS : Objects
Classes
Polymorphism
Overloading
Overriding
Abstraction
Data Encapsulation
Inheritance
Creation of Objects
1. Calling objects using Methods
2. Difference between OOPs and Procedure Based
Programming
WHY OOPS?
● OOP was introduced to overcome flaws in the procedural approach to
programming
● Such as lack of reusability and maintainability
Machine Language
Assembly Language
Structured
Programming
Language
Procedural
Programming
Language
Object Oriented
Programming
WHAT IS OOPS?
● Object oriented programming (OOP) is a programming technique in which
programs are written on the basis of objects
● In OOP, problem is divided into number of entities called objects and then
builds data and functions around these objects
● Data of objects can be accessed only by the functions associated with the
objects
● Communication between objects is done through functions
● Follows bottom-up approach in program design
OBJECTS
● Object is the basic unit of object oriented programming.Objects are identified by its
unique name.
● An object represents a particular instance of a class.They may represent a person,a place
or any item that the program must handle
● An object is a collection of data members and associated member functions also known
as methods.
CLASSES
● Classes are data types based on which objects are created.
● Thus a class represents a set of individual objects.
● Objects are variables of class.
● A class is a collection of objects of similar type.
● Example: Student ram, sham;
● In example ram and sham are name of objects fo class Student,We can create any
number of objects for class
CHARACTERISTICS:POLYMORPHISM
● Polymorphism is derived from 2 greek words: poly and morphs. The word "poly"
means many and "morphs" means forms. So polymorphism means many forms.
● Polymorphism is an object-oriented programming concept that refers to the ability of a
variable,function or object to take on multiple forms.
● Suppose if you are in class room that time you behave like a student, when you are in
market at that time you behave like a customer, when you at your home at that time
you behave like a son or daughter, Here one person present in different-different
behaviors.
Compile time polymorphism: It is also known as static polymorphism. This type of
polymorphism is achieved by function overloading or operator overloading.
Runtime polymorphism: It is also known as Dynamic Method Dispatch. It is a process in which
a function call to the overridden method is resolved at Runtime. This type of polymorphism is
achieved by Method Overriding.
OVERLOADING
● When there are multiple functions with same name but different parameters
then these functions are said to be overloaded. Functions can be overloaded by
change in number of arguments or/and change in type of arguments.
● Example: 1)By using different types of arguments
● 2) We can make the operator (‘+’) for string class to concatenate two strings.
We know that this is the addition operator whose task is to add two operands.
So a single operator ‘+’ when placed between integer operands, adds them and
when placed between string operands, concatenates them.
OVERRIDING
● Method overriding, occurs when a derived class has a definition for one of the
member functions of the base class. That base function is said to be
overridden.
● You can have a method in subclass
overrides the method in its
super classes with the same name
and signature.
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Curabitur eleifend a diam
quis suscipit. Fusce venenatis nunc ut
lectus convallis, sit amet egestas mi
rutrum. Maecenas molestie ultricies
euismod. Morbi a rutrum nisl. Vestibulum
laoreet enim id sem fermentum, sed
aliquam arcu dictum. Donec ultrices diam
sagittis nibh pellentesque eleifend.
CHARACTERISTICS:ABSTRACTION
● Providing only essential information about the data
to the outside world, hiding the background details
or implementation.
● Need to know:
○ Methods of the object are available
○ Input parameters needed
● Need not know:
○ How the method is implemented?
○ Which kinds of actions it has to perform?
● Example:The man only knows applying brakes will
stop the car but he does not know about the inner
mechanism of the car.
CHARACTERISTICS:ENCAPSULATION
Lorem Ipsum
● Binds together the data and functions that
manipulate the data.
● Hide the internal representation, or state, of an
object from the outside. This is called information
hiding.
● Example: Calculator
○ Press 2+2 then see the result on display.
○ Don't have to know how it works inside.
● Advantages
○ Control over the data
○ Data hiding
ENCAPSULATION ~ ABSTRACTION??????
CHARACTERISTICS:INHERITANCE
● Mechanism in which one object acquires all
the properties and behaviors of a parent
object.
● The “extends” keyword indicates that you
are making a new class that derives from an
existing class.
● Why use it:
○ For Method Overriding
○ For Code Reusability
class Animal{
void
eat(){System.out.println("eating...");}
}
class Dog extends Animal{
void bark()
{System.out.println("barking...");}
}
class TestInheritance{
public static void main(String args[]){
Dog d=new Dog();
d.bark();
d.eat();
}}
CREATION OF OBJECTS
How to Declare, Create and Initialize an Object in Java
A class is a blueprint for Object, you can create an object from a class. Let's take
Student class and try to create Java object for it.
Let's create a simple Student class which has name and college fields.
Let's write a program to create declare, create and initialize a Student object in
Java.
public class Student {
private String name;
private String college;
public Student(String n, String c) {
name = n;
college = c;
}
public static void main(String[] args) {
Student student = new Student("Ramesh",
"BVB");
Student student2 = new Student("Prakash",
"GEC");
Student student3 = new Student("Pramod",
"IIT");}
}
Simple Program Demonstrating The Creation Of Objects
Using ‘New’ Keyword
From the above program, the Student objects are:
Student student = new Student("Ramesh", "BVB");
Student student2 = new Student("Prakash", "GEC");
Student student3 = new Student("Pramod", "IIT");
Each of these statements has three parts:
Declaration: The code Student student; declarations that associate
a variable name with an object type.
Instantiation: The new keyword is a Java operator that creates the
object.
Initialization: The new operator is followed by a call to a
constructor, which initializes the new object.
CALLING OBJECTS USING METHODS
Now, we have the complete program below which creates three Student objects and invokes
the printDetails() method on each of these objects.
public class StudentTest {
public void printdetails(String name,String
college)
{
System.out.println(“Name of
student is: “+ name + “n”);
System.out.println(“Name of
college student is studying in: “+ college +
“n”);
}
public static void main ( String[] args ) {
Student s1 = new Student
(“Ramesh”,”BVB”) ;
Student s2 = new Student ( "Prakash", “GEC” );
Student s3 = new Student ( "Pramod" , “IIT”);
System.out.println("Student s1:n ");
s1.printDetails();
System.out.println("nStudent s2: ");
s2.printDetails();
System.out.println("nStudent s3: ");
s3.printDetails(); }
When we run this program, we get the following output:
Student s1:
Name of student is: Ramesh
Name of college student is studying in is: BVB
Student s2:
Name of student is: Prakash
Name of college student is studying in is: GEC
Student s3:
Name of student is: Pramod
Name of college student is studying in is: IIT
Now that we have created the objects, we will look into how the variables and methods of these objects
can be accessed. In order to access a variable or a method, we use the reference/dot operator (.) in the
following way:
s1.printDetails();
The above statement invokes the printDetails() method on the Student object s1. If the method requires
arguments, we state them within the parentheses. Variables too are accessed in a similar way, except
that the parentheses are not included. This is what separates the variables from methods and helps us
to distinguish between the two. If the name variable was public we could have used the following
statement to assign a String to the name variables of s1 in the following way:
s1.name="Ram";
We can also print these values, as we would have printed a String variable if the variable was declared
as public.
System.out.println("Name is "+ s1.name);
But, for the current objects such access is denied since the variables were declared to be private which
means that the variables are not accessible outside the class.
DIFFERENCE BETWEEN OBJECT ORIENTED PROGRAMMING AND
PROCEDURAL PROGRAMMING
Object Based Programming Procedure-Based Programming
Focuses on data Focuses on doing things(functions)
Follows bottom-up approach Follows top-down approach
Data abstraction and data hiding feature
prevents accidental change in data
Use of global variables puts the data at risk
Extending the program is easier than
procedure-based programming
Extending the program is a difficult task
THANK YOU

More Related Content

What's hot

Oop in kotlin
Oop in kotlinOop in kotlin
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
deonpmeyer
 
Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part II
Ajit Nayak
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
Digvijay Singh Karakoti
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
Ajay Chimmani
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
William Olivier
 
Classes and Inheritance
Classes and InheritanceClasses and Inheritance
Classes and Inheritance
emartinez.romero
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
Pina Parmar
 
SEMINAR
SEMINARSEMINAR
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
MOHIT TOMAR
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
Ahmed Gad
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
rahuld115
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
Elizabeth alexander
 
Concept of Object Oriented Programming
Concept of Object Oriented Programming Concept of Object Oriented Programming
Concept of Object Oriented Programming
Prognoz Technologies Pvt. Ltd.
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
Abhishek Wadhwa
 
Oop concept
Oop conceptOop concept
Oop concept
Waseem Mehmood
 
What is OOP?
What is OOP?What is OOP?
What is OOP?
Amin Uddin
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
OUM SAOKOSAL
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
Jawad Khan
 

What's hot (20)

Oop in kotlin
Oop in kotlinOop in kotlin
Oop in kotlin
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Object Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part IIObject Oriented Programming using C++ Part II
Object Oriented Programming using C++ Part II
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
 
Classes and Inheritance
Classes and InheritanceClasses and Inheritance
Classes and Inheritance
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
SEMINAR
SEMINARSEMINAR
SEMINAR
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
Concept of Object Oriented Programming
Concept of Object Oriented Programming Concept of Object Oriented Programming
Concept of Object Oriented Programming
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 
Oop concept
Oop conceptOop concept
Oop concept
 
What is OOP?
What is OOP?What is OOP?
What is OOP?
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
 
Inheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphismInheritance, friend function, virtual function, polymorphism
Inheritance, friend function, virtual function, polymorphism
 

Similar to Object Oriented Programming Concepts

OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
Maharshi Dayanand University Rohtak
 
Lecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With PythonLecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With Python
National College of Business Administration & Economics ( NCBA&E)
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
Geophery sanga
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
nitamhaske
 
Seminar
SeminarSeminar
oopusingc.pptx
oopusingc.pptxoopusingc.pptx
oopusingc.pptx
MohammedAlobaidy16
 
Java căn bản - Chapter13
Java căn bản - Chapter13Java căn bản - Chapter13
Java căn bản - Chapter13
Vince Vo
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and Polymorphism
Eduardo Bergavera
 
Regex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overlodingRegex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overloding
sangumanikesh
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
ITNet
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
HouseMusica
 
oopm 2.pdf
oopm 2.pdfoopm 2.pdf
oopm 2.pdf
jayeshsoni49
 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
AshutoshTrivedi30
 
Oop ppt
Oop pptOop ppt
Oop ppt
Shani Manjara
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
Maryo Manjaruni
 
OOP in java
OOP in javaOOP in java
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
java - oop's in depth journey
java - oop's in depth journeyjava - oop's in depth journey
java - oop's in depth journey
Sudharsan Selvaraj
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
sandeep54552
 

Similar to Object Oriented Programming Concepts (20)

OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
 
Lecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With PythonLecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With Python
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Seminar
SeminarSeminar
Seminar
 
oopusingc.pptx
oopusingc.pptxoopusingc.pptx
oopusingc.pptx
 
Java căn bản - Chapter13
Java căn bản - Chapter13Java căn bản - Chapter13
Java căn bản - Chapter13
 
Chapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and PolymorphismChapter 13 - Inheritance and Polymorphism
Chapter 13 - Inheritance and Polymorphism
 
Regex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overlodingRegex,functions, inheritance,class, attribute,overloding
Regex,functions, inheritance,class, attribute,overloding
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
oopm 2.pdf
oopm 2.pdfoopm 2.pdf
oopm 2.pdf
 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
 
Oop ppt
Oop pptOop ppt
Oop ppt
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
 
OOP in java
OOP in javaOOP in java
OOP in java
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
java - oop's in depth journey
java - oop's in depth journeyjava - oop's in depth journey
java - oop's in depth journey
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 

Recently uploaded

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Recently uploaded (20)

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

Object Oriented Programming Concepts

  • 2. TABLE OF CONTENTS 1. Introduction to OOPS 2. Characteristics of OOPS : Objects Classes Polymorphism Overloading Overriding Abstraction Data Encapsulation Inheritance Creation of Objects 1. Calling objects using Methods 2. Difference between OOPs and Procedure Based Programming
  • 3. WHY OOPS? ● OOP was introduced to overcome flaws in the procedural approach to programming ● Such as lack of reusability and maintainability Machine Language Assembly Language Structured Programming Language Procedural Programming Language Object Oriented Programming
  • 4. WHAT IS OOPS? ● Object oriented programming (OOP) is a programming technique in which programs are written on the basis of objects ● In OOP, problem is divided into number of entities called objects and then builds data and functions around these objects ● Data of objects can be accessed only by the functions associated with the objects ● Communication between objects is done through functions ● Follows bottom-up approach in program design
  • 5. OBJECTS ● Object is the basic unit of object oriented programming.Objects are identified by its unique name. ● An object represents a particular instance of a class.They may represent a person,a place or any item that the program must handle ● An object is a collection of data members and associated member functions also known as methods.
  • 6. CLASSES ● Classes are data types based on which objects are created. ● Thus a class represents a set of individual objects. ● Objects are variables of class. ● A class is a collection of objects of similar type. ● Example: Student ram, sham; ● In example ram and sham are name of objects fo class Student,We can create any number of objects for class
  • 7. CHARACTERISTICS:POLYMORPHISM ● Polymorphism is derived from 2 greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means many forms. ● Polymorphism is an object-oriented programming concept that refers to the ability of a variable,function or object to take on multiple forms. ● Suppose if you are in class room that time you behave like a student, when you are in market at that time you behave like a customer, when you at your home at that time you behave like a son or daughter, Here one person present in different-different behaviors.
  • 8. Compile time polymorphism: It is also known as static polymorphism. This type of polymorphism is achieved by function overloading or operator overloading. Runtime polymorphism: It is also known as Dynamic Method Dispatch. It is a process in which a function call to the overridden method is resolved at Runtime. This type of polymorphism is achieved by Method Overriding.
  • 9. OVERLOADING ● When there are multiple functions with same name but different parameters then these functions are said to be overloaded. Functions can be overloaded by change in number of arguments or/and change in type of arguments. ● Example: 1)By using different types of arguments ● 2) We can make the operator (‘+’) for string class to concatenate two strings. We know that this is the addition operator whose task is to add two operands. So a single operator ‘+’ when placed between integer operands, adds them and when placed between string operands, concatenates them.
  • 10. OVERRIDING ● Method overriding, occurs when a derived class has a definition for one of the member functions of the base class. That base function is said to be overridden. ● You can have a method in subclass overrides the method in its super classes with the same name and signature.
  • 11. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eleifend a diam quis suscipit. Fusce venenatis nunc ut lectus convallis, sit amet egestas mi rutrum. Maecenas molestie ultricies euismod. Morbi a rutrum nisl. Vestibulum laoreet enim id sem fermentum, sed aliquam arcu dictum. Donec ultrices diam sagittis nibh pellentesque eleifend. CHARACTERISTICS:ABSTRACTION ● Providing only essential information about the data to the outside world, hiding the background details or implementation. ● Need to know: ○ Methods of the object are available ○ Input parameters needed ● Need not know: ○ How the method is implemented? ○ Which kinds of actions it has to perform? ● Example:The man only knows applying brakes will stop the car but he does not know about the inner mechanism of the car.
  • 12. CHARACTERISTICS:ENCAPSULATION Lorem Ipsum ● Binds together the data and functions that manipulate the data. ● Hide the internal representation, or state, of an object from the outside. This is called information hiding. ● Example: Calculator ○ Press 2+2 then see the result on display. ○ Don't have to know how it works inside. ● Advantages ○ Control over the data ○ Data hiding
  • 14. CHARACTERISTICS:INHERITANCE ● Mechanism in which one object acquires all the properties and behaviors of a parent object. ● The “extends” keyword indicates that you are making a new class that derives from an existing class. ● Why use it: ○ For Method Overriding ○ For Code Reusability class Animal{ void eat(){System.out.println("eating...");} } class Dog extends Animal{ void bark() {System.out.println("barking...");} } class TestInheritance{ public static void main(String args[]){ Dog d=new Dog(); d.bark(); d.eat(); }}
  • 15. CREATION OF OBJECTS How to Declare, Create and Initialize an Object in Java A class is a blueprint for Object, you can create an object from a class. Let's take Student class and try to create Java object for it. Let's create a simple Student class which has name and college fields. Let's write a program to create declare, create and initialize a Student object in Java.
  • 16. public class Student { private String name; private String college; public Student(String n, String c) { name = n; college = c; } public static void main(String[] args) { Student student = new Student("Ramesh", "BVB"); Student student2 = new Student("Prakash", "GEC"); Student student3 = new Student("Pramod", "IIT");} } Simple Program Demonstrating The Creation Of Objects Using ‘New’ Keyword
  • 17. From the above program, the Student objects are: Student student = new Student("Ramesh", "BVB"); Student student2 = new Student("Prakash", "GEC"); Student student3 = new Student("Pramod", "IIT"); Each of these statements has three parts: Declaration: The code Student student; declarations that associate a variable name with an object type. Instantiation: The new keyword is a Java operator that creates the object. Initialization: The new operator is followed by a call to a constructor, which initializes the new object.
  • 18. CALLING OBJECTS USING METHODS Now, we have the complete program below which creates three Student objects and invokes the printDetails() method on each of these objects. public class StudentTest { public void printdetails(String name,String college) { System.out.println(“Name of student is: “+ name + “n”); System.out.println(“Name of college student is studying in: “+ college + “n”); } public static void main ( String[] args ) { Student s1 = new Student (“Ramesh”,”BVB”) ; Student s2 = new Student ( "Prakash", “GEC” ); Student s3 = new Student ( "Pramod" , “IIT”); System.out.println("Student s1:n "); s1.printDetails(); System.out.println("nStudent s2: "); s2.printDetails(); System.out.println("nStudent s3: "); s3.printDetails(); }
  • 19. When we run this program, we get the following output: Student s1: Name of student is: Ramesh Name of college student is studying in is: BVB Student s2: Name of student is: Prakash Name of college student is studying in is: GEC Student s3: Name of student is: Pramod Name of college student is studying in is: IIT
  • 20. Now that we have created the objects, we will look into how the variables and methods of these objects can be accessed. In order to access a variable or a method, we use the reference/dot operator (.) in the following way: s1.printDetails(); The above statement invokes the printDetails() method on the Student object s1. If the method requires arguments, we state them within the parentheses. Variables too are accessed in a similar way, except that the parentheses are not included. This is what separates the variables from methods and helps us to distinguish between the two. If the name variable was public we could have used the following statement to assign a String to the name variables of s1 in the following way: s1.name="Ram"; We can also print these values, as we would have printed a String variable if the variable was declared as public. System.out.println("Name is "+ s1.name); But, for the current objects such access is denied since the variables were declared to be private which means that the variables are not accessible outside the class.
  • 21. DIFFERENCE BETWEEN OBJECT ORIENTED PROGRAMMING AND PROCEDURAL PROGRAMMING Object Based Programming Procedure-Based Programming Focuses on data Focuses on doing things(functions) Follows bottom-up approach Follows top-down approach Data abstraction and data hiding feature prevents accidental change in data Use of global variables puts the data at risk Extending the program is easier than procedure-based programming Extending the program is a difficult task

Editor's Notes

  1. Please do change the order of table of contents based on the order of presenting