SlideShare a Scribd company logo
Dr. A. Haja Abdul Khader
Assistant Professor of Computer Science
11-08-2020
1
What is OOP
Object-oriented programming System(OOPs) is
a programming paradigm based on the
concept of “objects” that contain data and
methods.
The primary purpose of object-oriented
programming is to increase the flexibility and
maintainability of programs
Object oriented programming brings together
data and its behaviour(methods) in a single
location(object) makes it easier to understand
how a program works.
11-08-2020
2
Difference Between POP and OOP
11-08-2020
3
Procedural Oriented Programming Object Oriented Programming
In procedural programming, program is
divided into small parts called functions.
In object oriented programming,
program is divided into small parts
called objects.
Procedural programming follows top
down approach.
Object oriented programming follows
bottom up approach.
There is no access specifier in
procedural programming.
Object oriented programming have
access specifiers like private, public,
protected etc.
Adding new data and function is not
easy.
Adding new data and function is easy.
Difference Between POP and OOP
11-08-2020
4
Procedural Oriented Programming Object Oriented Programming
Procedural programming does not
have any proper way for hiding data
so it is less secure.
Object oriented programming
provides data hiding so it is more
secure.
In procedural programming,
overloading is not possible.
Overloading is possible in object
oriented programming.
In procedural programming, function
is more important than data.
In object oriented programming, data
is more important than function.
Difference Between POP and OOP
11-08-2020
5
Procedural Oriented Programming Object Oriented Programming
Procedural programming is based on
unreal world.
Object oriented programming is
based on real world.
Examples: C, FORTRAN, Pascal, Basic
etc.
Examples: C++, Java, Python, C# etc.
Advantages of OOP
1) OOPs makes development and maintenance
easier, whereas, in a procedure-oriented
programming language, it is not easy to
manage if code grows as project size increases.
2) OOPs provides data hiding, whereas, in a
procedure-oriented programming language,
global data can be accessed from anywhere.
11-08-2020
6
Advantages of OOP
3) OOPs provides the ability to simulate real-
world event much more effectively. We can
provide the solution of real word problem if we
are using the Object-Oriented Programming
language.
11-08-2020
7
What is an Object
 Any entity that has state and behavior is known
as an object. For example, a chair, pen, table,
keyboard, bike, etc. It can be physical or
logical.
An Object can be defined as an instance of a
class. An object contains an address and takes
up some space in memory.
11-08-2020
8
What is an Object
 Objects can communicate without knowing the
details of each other's data or code.
 The only necessary thing is the type of message
accepted and the type of response returned by
the objects.
Example: A dog is an object because it has
states like color, name, breed, etc. as well as
behaviors like wagging the tail, barking, eating,
etc.
11-08-2020
9
What is an Object
11-08-2020
10
What is Class
 A collection of objects is called a class.
It is a logical entity.
A class can also be defined as a blueprint from
which you can create an individual object.
Class doesn't consume any space
11-08-2020
11
OOP Concepts in Java
There are four main OOP concepts in Java.
These are:
Abstraction
Encapsulation
Inheritance
Polymorphism
11-08-2020
12
Abstraction
Hiding internal details and showing functionality
is known as abstraction.
Abstraction means using simple things to
represent complexity.
We all know how to turn the TV on, but we don’t
need to know how it works in order to enjoy it.
11-08-2020
13
Abstraction
In Java, abstraction means simple things like
objects, classes, and variables represent more
complex underlying code and data.
This is important because it lets avoid repeating
the same work multiple times.
11-08-2020
14
How Abstraction Works
Abstraction as an OOP concept in Java works
by letting programmers create useful, reusable
tools.
For example, a programmer can create several
different types of objects. These can be
variables, functions, or data structures.
Programmers can also create different classes
of objects. These are ways to define the objects.
11-08-2020
15
Encapsulation
Binding (or wrapping) code and data together
into a single unit are known as encapsulation.
 For example, a capsule, it is wrapped with
different medicines.
11-08-2020
16
Encapsulation
This is the practice of keeping fields within a
class private, then providing access to them via
public methods.
It’s a protective barrier that keeps the data and
code safe within the class itself.
 This way, we can re-use objects like code
components or variables without allowing open
access to the data system-wide.
11-08-2020
17
How Encapsulation Works
This is the practice of keeping fields within a
class private, then providing access to them via
public methods.
It’s a protective barrier that keeps the data and
code safe within the class itself.
 This way, we can re-use objects like code
components or variables without allowing open
access to the data system-wide.
11-08-2020
18
How Encapsulation Works
Encapsulation lets us re-use functionality without
jeopardizing security.
It’s a powerful OOP concept in Java because it
helps us save a lot of time.
 For example, we may create a piece of code
that calls specific data from a database.
11-08-2020
19
How Encapsulation Works
It may be useful to reuse that code with other
databases or processes.
Encapsulation lets us do that while keeping our
original data private.
It also lets us alter our original code without
breaking it for others who have adopted it in the
meantime.
11-08-2020
20
Inheritance
The process by which one class acquires the
properties and functionalities of another class is
called inheritance.
Inheritance provides the idea of reusability of
code and each sub class defines only those
features that are unique to it, rest of the features
can be inherited from the parent class.
11-08-2020
21
Inheritance
The process by which one class acquires the
properties and functionalities of another class is
called inheritance.
Inheritance provides the idea of reusability of
code and each sub class defines only those
features that are unique to it, rest of the features
can be inherited from the parent class.
11-08-2020
22
Inheritance
Inheritance is a process of defining a new class
based on an existing class by extending its
common data members and methods.
Inheritance allows us to reuse of code, it
improves reusability in your java application.
The parent class is called the base class or super
class. The child class that extends the base class
is called the derived class or sub class or child
class.
11-08-2020
23
How Inheritance Works
Inheritance is another labor-saving Java OOP
concept.
 It works by letting a new class adopt the
properties of another.
We call the inheriting class a subclass or a child
class.
The original class is often called the parent.
 We use the keyword extends to define a new
class that inherits properties from an old class.
11-08-2020
24
Polymorphism
If one task is performed in different ways, it is
known as polymorphism.
For example: to convince the customer
differently, to draw something, for example,
shape, triangle, rectangle, etc.
There are two kinds of polymorphism:
1. Static (Compile-time)
2. Dynamic( Run-time)
11-08-2020
25
Polymorphism
This Java OOP concept lets programmers use
the same word to mean different things in
different contexts.
 One form of polymorphism in Java is method
overloading
That’s when different meanings are implied by
the code itself. The other form is method
overriding.
That’s when the different meanings are implied
by the values of the supplied variables. 11-08-2020
26
How Polymorphism Works
Polymorphism in Java works by using a
reference to a parent class to affect an object
in the child class.
 We might create a class called “horse” by
extending the “animal” class. That class might
also implement the “professional racing” class.
The “horse” class is “polymorphic,” since it
inherits attributes of both the “animal” and
“professional racing” class.
11-08-2020
27
How Polymorphism Works
11-08-2020
28

More Related Content

What's hot

OOP
OOPOOP
Oops
OopsOops
Oops
Prabhu R
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Md. Tanvir Hossain
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
Andrew Ferlitsch
 
Lecture01 object oriented-programming
Lecture01 object oriented-programmingLecture01 object oriented-programming
Lecture01 object oriented-programmingHariz Mustafa
 
itft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in javaitft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in java
Atul Sehdev
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Object oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyayObject oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh Upadhyay
Saurabh Upadhyay
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
Hemant Saini
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
gourav kottawar
 
Oops
OopsOops
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programmingAbzetdin Adamov
 
Oops slide
Oops slide Oops slide
Oops slide
Ashok Sharma
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
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
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented ProgrammingAida Ramlan II
 

What's hot (20)

OOP
OOPOOP
OOP
 
Oops
OopsOops
Oops
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
 
Lecture01 object oriented-programming
Lecture01 object oriented-programmingLecture01 object oriented-programming
Lecture01 object oriented-programming
 
itft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in javaitft-Fundamentals of object–oriented programming in java
itft-Fundamentals of object–oriented programming in java
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Object oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh UpadhyayObject oriented programming concept- Saurabh Upadhyay
Object oriented programming concept- Saurabh Upadhyay
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
 
Oops
OopsOops
Oops
 
Oops Concepts
Oops ConceptsOops Concepts
Oops Concepts
 
Oops
OopsOops
Oops
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
 
Oops slide
Oops slide Oops slide
Oops slide
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
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
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented Programming
 

Similar to Ah java-ppt2

MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
RAJASEKHARV10
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
ayankamila005
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
Mohammad Kamrul Hasan
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
Muhammad Nawzir Khan
 
1 intro
1 intro1 intro
1 intro
abha48
 
Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
Narayanan sockalinganathan
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
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
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
kalyanibedekar
 
Java OOPs Concepts.docx
Java OOPs Concepts.docxJava OOPs Concepts.docx
Java OOPs Concepts.docx
FredWauyo
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
Sujith Kumar
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
HouseMusica
 

Similar to Ah java-ppt2 (20)

MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
1 intro
1 intro1 intro
1 intro
 
Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
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
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
Java OOPs Concepts.docx
Java OOPs Concepts.docxJava OOPs Concepts.docx
Java OOPs Concepts.docx
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 

Recently uploaded

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 

Recently uploaded (20)

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Ah java-ppt2

  • 1. Dr. A. Haja Abdul Khader Assistant Professor of Computer Science 11-08-2020 1
  • 2. What is OOP Object-oriented programming System(OOPs) is a programming paradigm based on the concept of “objects” that contain data and methods. The primary purpose of object-oriented programming is to increase the flexibility and maintainability of programs Object oriented programming brings together data and its behaviour(methods) in a single location(object) makes it easier to understand how a program works. 11-08-2020 2
  • 3. Difference Between POP and OOP 11-08-2020 3 Procedural Oriented Programming Object Oriented Programming In procedural programming, program is divided into small parts called functions. In object oriented programming, program is divided into small parts called objects. Procedural programming follows top down approach. Object oriented programming follows bottom up approach. There is no access specifier in procedural programming. Object oriented programming have access specifiers like private, public, protected etc. Adding new data and function is not easy. Adding new data and function is easy.
  • 4. Difference Between POP and OOP 11-08-2020 4 Procedural Oriented Programming Object Oriented Programming Procedural programming does not have any proper way for hiding data so it is less secure. Object oriented programming provides data hiding so it is more secure. In procedural programming, overloading is not possible. Overloading is possible in object oriented programming. In procedural programming, function is more important than data. In object oriented programming, data is more important than function.
  • 5. Difference Between POP and OOP 11-08-2020 5 Procedural Oriented Programming Object Oriented Programming Procedural programming is based on unreal world. Object oriented programming is based on real world. Examples: C, FORTRAN, Pascal, Basic etc. Examples: C++, Java, Python, C# etc.
  • 6. Advantages of OOP 1) OOPs makes development and maintenance easier, whereas, in a procedure-oriented programming language, it is not easy to manage if code grows as project size increases. 2) OOPs provides data hiding, whereas, in a procedure-oriented programming language, global data can be accessed from anywhere. 11-08-2020 6
  • 7. Advantages of OOP 3) OOPs provides the ability to simulate real- world event much more effectively. We can provide the solution of real word problem if we are using the Object-Oriented Programming language. 11-08-2020 7
  • 8. What is an Object  Any entity that has state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc. It can be physical or logical. An Object can be defined as an instance of a class. An object contains an address and takes up some space in memory. 11-08-2020 8
  • 9. What is an Object  Objects can communicate without knowing the details of each other's data or code.  The only necessary thing is the type of message accepted and the type of response returned by the objects. Example: A dog is an object because it has states like color, name, breed, etc. as well as behaviors like wagging the tail, barking, eating, etc. 11-08-2020 9
  • 10. What is an Object 11-08-2020 10
  • 11. What is Class  A collection of objects is called a class. It is a logical entity. A class can also be defined as a blueprint from which you can create an individual object. Class doesn't consume any space 11-08-2020 11
  • 12. OOP Concepts in Java There are four main OOP concepts in Java. These are: Abstraction Encapsulation Inheritance Polymorphism 11-08-2020 12
  • 13. Abstraction Hiding internal details and showing functionality is known as abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but we don’t need to know how it works in order to enjoy it. 11-08-2020 13
  • 14. Abstraction In Java, abstraction means simple things like objects, classes, and variables represent more complex underlying code and data. This is important because it lets avoid repeating the same work multiple times. 11-08-2020 14
  • 15. How Abstraction Works Abstraction as an OOP concept in Java works by letting programmers create useful, reusable tools. For example, a programmer can create several different types of objects. These can be variables, functions, or data structures. Programmers can also create different classes of objects. These are ways to define the objects. 11-08-2020 15
  • 16. Encapsulation Binding (or wrapping) code and data together into a single unit are known as encapsulation.  For example, a capsule, it is wrapped with different medicines. 11-08-2020 16
  • 17. Encapsulation This is the practice of keeping fields within a class private, then providing access to them via public methods. It’s a protective barrier that keeps the data and code safe within the class itself.  This way, we can re-use objects like code components or variables without allowing open access to the data system-wide. 11-08-2020 17
  • 18. How Encapsulation Works This is the practice of keeping fields within a class private, then providing access to them via public methods. It’s a protective barrier that keeps the data and code safe within the class itself.  This way, we can re-use objects like code components or variables without allowing open access to the data system-wide. 11-08-2020 18
  • 19. How Encapsulation Works Encapsulation lets us re-use functionality without jeopardizing security. It’s a powerful OOP concept in Java because it helps us save a lot of time.  For example, we may create a piece of code that calls specific data from a database. 11-08-2020 19
  • 20. How Encapsulation Works It may be useful to reuse that code with other databases or processes. Encapsulation lets us do that while keeping our original data private. It also lets us alter our original code without breaking it for others who have adopted it in the meantime. 11-08-2020 20
  • 21. Inheritance The process by which one class acquires the properties and functionalities of another class is called inheritance. Inheritance provides the idea of reusability of code and each sub class defines only those features that are unique to it, rest of the features can be inherited from the parent class. 11-08-2020 21
  • 22. Inheritance The process by which one class acquires the properties and functionalities of another class is called inheritance. Inheritance provides the idea of reusability of code and each sub class defines only those features that are unique to it, rest of the features can be inherited from the parent class. 11-08-2020 22
  • 23. Inheritance Inheritance is a process of defining a new class based on an existing class by extending its common data members and methods. Inheritance allows us to reuse of code, it improves reusability in your java application. The parent class is called the base class or super class. The child class that extends the base class is called the derived class or sub class or child class. 11-08-2020 23
  • 24. How Inheritance Works Inheritance is another labor-saving Java OOP concept.  It works by letting a new class adopt the properties of another. We call the inheriting class a subclass or a child class. The original class is often called the parent.  We use the keyword extends to define a new class that inherits properties from an old class. 11-08-2020 24
  • 25. Polymorphism If one task is performed in different ways, it is known as polymorphism. For example: to convince the customer differently, to draw something, for example, shape, triangle, rectangle, etc. There are two kinds of polymorphism: 1. Static (Compile-time) 2. Dynamic( Run-time) 11-08-2020 25
  • 26. Polymorphism This Java OOP concept lets programmers use the same word to mean different things in different contexts.  One form of polymorphism in Java is method overloading That’s when different meanings are implied by the code itself. The other form is method overriding. That’s when the different meanings are implied by the values of the supplied variables. 11-08-2020 26
  • 27. How Polymorphism Works Polymorphism in Java works by using a reference to a parent class to affect an object in the child class.  We might create a class called “horse” by extending the “animal” class. That class might also implement the “professional racing” class. The “horse” class is “polymorphic,” since it inherits attributes of both the “animal” and “professional racing” class. 11-08-2020 27