SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Fundamentals of
OOP
Intro
• Object-oriented
programming
(OOP) is a
computer science
term used to
characterize a
programming
language that
began development
in the 1960’s
CONT….
• It consider the
programming
simulated to real
world objects.
• It help in
programming
approach in order
to built robust
user friendly and
efficient
software's and
provide the
efficient way to
maintain real
world software's.
CLASS
• The first concept
that you will need
to learn is called
a "class.“
• A class creates
the attributes of a
thing, and it will
also define the
processes that the
thing can carry
out.
• For example, a
class called
"cats"
OBJECT
An object can be defined as a
specific instance of a class.
As an example, while the class Cats
will provide all the attributes that are found in
all cats, the "object" named “HARLEY” is a
specific cat.
While it shares the same attributes
which are found in all cats, it has fur with a
unique color.
Example
In order to clearly understand the
object orientation, let’s take your “hand” as an
example.
The “hand” is a class. Your body has two
objects of type hand, named left hand and right hand.
Their main functions are controlled/ managed by a set
of electrical signals sent through your shoulders
(through an interface).
So the shoulder is an interface which
your body uses to interact with your hands. The hand is
a well architected class. The hand is being re-used to
create the left hand and the right hand by slightly
changing the properties of it.
Object
• An object stores
its state in fields
and exposes its
behavior through
methods.
• Methods operate
on an object's
internal state and
serve as the
primary
mechanism for
object-to-object
communication
CONT…..
• By attributing state
and providing
methods for
changing that state,
the object remains
in control of how
the outside world is
allowed to use it.
• For example, if the
bicycle only has 6
gears, a method to
change gears could
reject any value
that is less than 1 or
greater than 6.
INHERITANCE
• As the name suggests,
inheritance means to take
something that is already made.
• It is one of the most important
feature of Object Oriented
Programming.
• It is the concept that is used for
reusability purpose. Inheritance
is the mechanism through which
we can derived classes from
other classes.
CONT….
• The derived class is
called as child class or
the subclass or we
can say the extended
class and the class
from which we are
deriving the subclass
is called the base class
or the parent class.
• To derive a class in
java the keyword
extends is used.
INTERFACE
• An interface is a
collection of abstract
methods.
• A class implements an
interface, thereby
inheriting the abstract
methods of the
interface.
• An interface is not a
class. Writing an
interface is similar to
writing a class, but they
are two different
concepts.
CONT….
• A class describes the
attributes and
behaviors of an
object. An interface
contains behaviors
that a class
implements.
• Unless the class that
implements the
interface is abstract,
all the methods of the
interface need to be
defined in the class.
PACKAGES
• A Java package is a
mechanism for
organizing Java
classes into
namespaces similar
to the modules of
Modula.
• Java packages can
be stored in
compressed files
called JAR files,
allowing classes to
download faster as
a group rather than
one at a time.
CONT…
• Programmers also
typically use packages
to organize classes
belonging to the same
category or providing
similar functionality.
• A package provides a
unique namespace for
the types it contains.
• Classes in the same
package can access
each other's package-
access members.
DATA
ABSTRACTION
• Data abstraction
refers to,
providing only
essential
information to the
outside word and
hiding their
background
details .
• Data abstraction
is a programming
technique that
relies on the
separation of
interface and
implementation.
EXAMPLE….
Example of a
TV which you can turn
on and off, change the
channel, adjust the
volume, and add external
components such as
speakers, VCRs, and
DVD players.
BUT we do not
know it's internal detail
that is, you do not know
how it receives signals
over the air or through a
cable, how it translates
them, and finally displays
them on the screen.
ENCAPSULATION
It is an
attribute of
object design. It
means that all of
the object's data
is contained and
hidden in the
object and access
to it restricted to
members of that
class.
POLYMORPHISM
• It refers to a
programming
language’s ability to
process objects
differently depending
on their data type or
class.
• It is the ability to
redefine methods for
derived classes.
CONT…
For example,
given a base class shape,
polymorphism enables the
programmer to define
different area methods for
any number of derived
classes, such as circles,
rectangles and triangles.
No matter what
shape an object is, applying
the area method to it will
return the correct results.
Polymorphism
is considered to be a
requirement of any true
object-oriented
programming language
(OOPL).
DATA HIDING
Data Hiding is an
aspect of Object
Oriented
Programming (OOP)
that allows
developers to protect
private data and hide
implementation
details. In this
tutorial we examine
basic data hiding
techniques in Java.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Oops And C++ Fundamentals
Oops And C++ FundamentalsOops And C++ Fundamentals
Oops And C++ Fundamentals
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Concepts of oops
Concepts of oopsConcepts of oops
Concepts of oops
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Introduction to object oriented programming
Introduction to object oriented programmingIntroduction to object oriented programming
Introduction to object oriented programming
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
 
General oops concepts
General oops conceptsGeneral oops concepts
General oops concepts
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPs
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Unit 2
Unit 2Unit 2
Unit 2
 
Oop ppt
Oop pptOop ppt
Oop ppt
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
OOP
OOPOOP
OOP
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 

Similar a OOP Fundamentals: Object-Oriented Programming Concepts Explained

Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
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
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfBhanuJatinSingh
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentalsAnsgarMary
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oopcolleges
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingmustafa sarac
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++KAUSHAL KUMAR JHA
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals umesh patil
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programmingRiturajJain8
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdwrushabhsirsat
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesJessica Deakin
 

Similar a OOP Fundamentals: Object-Oriented Programming Concepts Explained (20)

General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
oop.pptx
oop.pptxoop.pptx
oop.pptx
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
Introduction to OOP.pptx
Introduction to OOP.pptxIntroduction to OOP.pptx
Introduction to OOP.pptx
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrdgxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
gxhrehsrejhvytftfltyflytdtydtydky5dyrdtrdrdtrd
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 

Más de Blossom Sood

ITFT - Web security
ITFT - Web securityITFT - Web security
ITFT - Web securityBlossom Sood
 
ITFT - Trends in it
ITFT - Trends in itITFT - Trends in it
ITFT - Trends in itBlossom Sood
 
ITFT - Search engine
ITFT - Search engineITFT - Search engine
ITFT - Search engineBlossom Sood
 
ITFT - Number system
ITFT - Number systemITFT - Number system
ITFT - Number systemBlossom Sood
 
ITFT - Java Coding
ITFT - Java CodingITFT - Java Coding
ITFT - Java CodingBlossom Sood
 
ITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemBlossom Sood
 
ITFT - Window explorer
ITFT - Window explorerITFT - Window explorer
ITFT - Window explorerBlossom Sood
 

Más de Blossom Sood (9)

ITFT- Dbms
ITFT- DbmsITFT- Dbms
ITFT- Dbms
 
ITFT - Web security
ITFT - Web securityITFT - Web security
ITFT - Web security
 
ITFT - Trends in it
ITFT - Trends in itITFT - Trends in it
ITFT - Trends in it
 
ITFT - Search engine
ITFT - Search engineITFT - Search engine
ITFT - Search engine
 
ITFT - Number system
ITFT - Number systemITFT - Number system
ITFT - Number system
 
ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
 
ITFT - Java Coding
ITFT - Java CodingITFT - Java Coding
ITFT - Java Coding
 
ITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating SystemITFT - DOS - Disk Operating System
ITFT - DOS - Disk Operating System
 
ITFT - Window explorer
ITFT - Window explorerITFT - Window explorer
ITFT - Window explorer
 

Último

How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 

Último (20)

How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 

OOP Fundamentals: Object-Oriented Programming Concepts Explained

  • 2. Intro • Object-oriented programming (OOP) is a computer science term used to characterize a programming language that began development in the 1960’s
  • 3. CONT…. • It consider the programming simulated to real world objects. • It help in programming approach in order to built robust user friendly and efficient software's and provide the efficient way to maintain real world software's.
  • 4. CLASS • The first concept that you will need to learn is called a "class.“ • A class creates the attributes of a thing, and it will also define the processes that the thing can carry out. • For example, a class called "cats"
  • 5.
  • 6. OBJECT An object can be defined as a specific instance of a class. As an example, while the class Cats will provide all the attributes that are found in all cats, the "object" named “HARLEY” is a specific cat. While it shares the same attributes which are found in all cats, it has fur with a unique color.
  • 7. Example In order to clearly understand the object orientation, let’s take your “hand” as an example. The “hand” is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.
  • 8. Object • An object stores its state in fields and exposes its behavior through methods. • Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication
  • 9. CONT….. • By attributing state and providing methods for changing that state, the object remains in control of how the outside world is allowed to use it. • For example, if the bicycle only has 6 gears, a method to change gears could reject any value that is less than 1 or greater than 6.
  • 10. INHERITANCE • As the name suggests, inheritance means to take something that is already made. • It is one of the most important feature of Object Oriented Programming. • It is the concept that is used for reusability purpose. Inheritance is the mechanism through which we can derived classes from other classes.
  • 11. CONT…. • The derived class is called as child class or the subclass or we can say the extended class and the class from which we are deriving the subclass is called the base class or the parent class. • To derive a class in java the keyword extends is used.
  • 12. INTERFACE • An interface is a collection of abstract methods. • A class implements an interface, thereby inheriting the abstract methods of the interface. • An interface is not a class. Writing an interface is similar to writing a class, but they are two different concepts.
  • 13. CONT…. • A class describes the attributes and behaviors of an object. An interface contains behaviors that a class implements. • Unless the class that implements the interface is abstract, all the methods of the interface need to be defined in the class.
  • 14. PACKAGES • A Java package is a mechanism for organizing Java classes into namespaces similar to the modules of Modula. • Java packages can be stored in compressed files called JAR files, allowing classes to download faster as a group rather than one at a time.
  • 15. CONT… • Programmers also typically use packages to organize classes belonging to the same category or providing similar functionality. • A package provides a unique namespace for the types it contains. • Classes in the same package can access each other's package- access members.
  • 16. DATA ABSTRACTION • Data abstraction refers to, providing only essential information to the outside word and hiding their background details . • Data abstraction is a programming technique that relies on the separation of interface and implementation.
  • 17. EXAMPLE…. Example of a TV which you can turn on and off, change the channel, adjust the volume, and add external components such as speakers, VCRs, and DVD players. BUT we do not know it's internal detail that is, you do not know how it receives signals over the air or through a cable, how it translates them, and finally displays them on the screen.
  • 18. ENCAPSULATION It is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class.
  • 19. POLYMORPHISM • It refers to a programming language’s ability to process objects differently depending on their data type or class. • It is the ability to redefine methods for derived classes.
  • 20. CONT… For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct results. Polymorphism is considered to be a requirement of any true object-oriented programming language (OOPL).
  • 21. DATA HIDING Data Hiding is an aspect of Object Oriented Programming (OOP) that allows developers to protect private data and hide implementation details. In this tutorial we examine basic data hiding techniques in Java.