SlideShare a Scribd company logo
Prepared by
Object Oriented Programming
Dr.Sasmita Pani
Asst. Prof., GIFT
What is OOPs?
 Object-Oriented Programming is a
methodology or paradigm to design a program
using classes and objects.
 It simplifies the software development and
maintenance by providing some concepts:
 Object
 Class
 Inheritance
 Polymorphism
 Abstraction
 Encapsulation
 Message Passing
2
Object?
 Objects are key to understanding object-
oriented technology. Look around right now and you'll
find many examples of real-world objects: your dog,
your desk, your television set, your bicycle.
 Real-world objects share two characteristics: They all
have state and behavior.
 Identifying the state and behavior for real-world
objects is a great way to begin thinking in terms of
object-oriented programming.
 Dogs have state (name, color, breed, hungry) and
behavior (barking, fetching, wagging tail). Bicycles
also have state (current gear, current pedal cadence,
current speed) and behavior (changing gear,
changing pedal cadence, applying brakes).
3
Object?
 Software objects are conceptually similar to real-
world objects: they too consist of state and
related behavior.
 An object stores its state in fields (variables in
some programming languages) and exposes its
behavior through methods (functions in some
programming languages).
 Methods operate on an object's internal state and
serve as the primary mechanism for object-to-
object communication.
4
Object?
A bicycle modeled as a software
object.
A software
object.
5
Class?
 A class is the blueprint from which individual
objects are created.
 It is a logical entity.
6
Class by Example
 In the real world, you'll often find many individual
objects all of the same kind.
 There may be thousands of other bicycles in
existence, all of the same make and model.
 Each bicycle was built from the same set of
blueprints and therefore contains the same
components.
 In object-oriented terms, we say that your bicycle
is an instance of the class of objects known as
bicycles
7
Class by Example
Syntax
modifier class myClass
{ //class header //field,
constructor //method
declarations
}
public class Dog
{
String breed;
int age; String color;
void barking() { }
void hungry() { }
void sleeping() { }
}
8
Abstraction
9
 Hiding internal details and showing functionality is
known as abstraction. For example: phone call, we don't
know the internal processing.
 In java, we use abstract class and interface to achieve
abstraction.
Example
 Let's take one real life 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 you do not know its internal details, 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.
 Thus, we can say a television clearly separates its internal
implementation from its external interface and you can play
with its interfaces like the power button, channel changer,
and volume control without having any knowledge of its
internals.
Encapsulation
10
 Binding (or wrapping) code and data together
into a single unit is known as encapsulation.
For example: capsule, it is wrapped with different
medicines.
 A java class is the example of encapsulation.
Java bean is the fully encapsulated class
because all the data members are private here.
Inheritance?
 When one object acquires all the properties
and behaviors of parent object i.e. known as
inheritance.
 It provides code reusability. It is used to achieve
runtime polymorphism.
 Object-oriented programming allows classes
to inherit commonly used state and behavior from
other classes.
11
Inheritance?
In this example, Bicycle now becomes the superclass of
MountainBike, RoadBike, and TandemBike. In the Java
programming language, each class is allowed to have one
direct superclass, and each superclass has the potential
for an unlimited number of subclasses:
12
Inheriting Syntax
 The syntax for creating a subclass is simple.
 At the beginning of your class declaration, use
the extends keyword, followed by the name of the class
to inherit from:
class MountainBike extends Bicycle {
// new fields and methods defining
// a mountain bike would go here
}
13
Interface?
 An interface is a group of related methods with
empty bodies.
 Methods form the object's interface with the
outside world; the buttons on the front of your
television set, for example, are the interface
between you and the electrical wiring on the other
side of its plastic casing. You press the "power"
button to turn the television on and off.
 Interfaces form a contract between the class and
the outside world, and this contract is enforced at
build time by the compiler.
14
Interface?
 The interface in java is a mechanism to achieve
fully abstraction.
 There can be only abstract methods in the java
interface not method body.
 It is used to achieve fully abstraction and multiple
inheritance in Java.
 Java Interface also represents IS-A
relationship.
 It cannot be instantiated just like abstract class.
15
Package?
 A package is a namespace that organizes a set of
related classes and interfaces.
 Conceptually you can think of packages as being
similar to different folders on your computer.
 The Java platform provides an enormous class
library (a set of packages) suitable for use in your
own applications. This library is known as the
"Application Programming Interface", or "API" for
short.
 Its packages represent the tasks most commonly
associated with general-purpose programming.
16
Polymorphism?
 When one task is performed by different
ways i.e. known as polymorphism. For example:
to convince the customer differently, to draw
something e.g. shape or rectangle etc.
 In java, we use method overloading and method
overriding to achieve polymorphism.
 Another example can be to speak something e.g.
cat speaks meaw, dog barks woof etc.
17
18

More Related Content

Similar to Introduction to OOP.pptx

FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2Rakesh Madugula
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
Nikhil Agrawal
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Sujit Majety
 
PROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxPROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptx
SeethaDinesh
 
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
Richa Gupta
 
Java OOP Concept
Java OOP ConceptJava OOP Concept
Java OOP Concept
NikitaGour5
 
Presentation on oo ps 2
Presentation on oo ps 2Presentation on oo ps 2
Presentation on oo ps 2Avinash Kumar
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
swapnilslide2019
 
ITFT - Oops
ITFT - OopsITFT - Oops
ITFT - Oops
Blossom Sood
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
Bharath Choudhary
 
Ah java-ppt2
Ah java-ppt2Ah java-ppt2
Ah java-ppt2
Haja Abdul Khader A
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptx
kristinatemen
 
Java notes jkuat it
Java notes jkuat itJava notes jkuat it
Java notes jkuat it
Arc Keepers Solutions
 
Core java
Core javaCore java
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
Jessica Deakin
 

Similar to Introduction to OOP.pptx (20)

FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
 
Java PPT
Java PPTJava PPT
Java PPT
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
PROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxPROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptx
 
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
 
2 oop
2 oop2 oop
2 oop
 
Java OOP Concept
Java OOP ConceptJava OOP Concept
Java OOP Concept
 
Presentation on oo ps 2
Presentation on oo ps 2Presentation on oo ps 2
Presentation on oo ps 2
 
Programming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdfProgramming Laboratory Unit 1.pdf
Programming Laboratory Unit 1.pdf
 
ITFT - Oops
ITFT - OopsITFT - Oops
ITFT - Oops
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
 
Ah java-ppt2
Ah java-ppt2Ah java-ppt2
Ah java-ppt2
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptx
 
Java notes jkuat it
Java notes jkuat itJava notes jkuat it
Java notes jkuat it
 
Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Core java
Core javaCore java
Core java
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 

Recently uploaded

Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 

Recently uploaded (20)

Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 

Introduction to OOP.pptx

  • 1. Prepared by Object Oriented Programming Dr.Sasmita Pani Asst. Prof., GIFT
  • 2. What is OOPs?  Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects.  It simplifies the software development and maintenance by providing some concepts:  Object  Class  Inheritance  Polymorphism  Abstraction  Encapsulation  Message Passing 2
  • 3. Object?  Objects are key to understanding object- oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle.  Real-world objects share two characteristics: They all have state and behavior.  Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming.  Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). 3
  • 4. Object?  Software objects are conceptually similar to real- world objects: they too consist of state and related behavior.  An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages).  Methods operate on an object's internal state and serve as the primary mechanism for object-to- object communication. 4
  • 5. Object? A bicycle modeled as a software object. A software object. 5
  • 6. Class?  A class is the blueprint from which individual objects are created.  It is a logical entity. 6
  • 7. Class by Example  In the real world, you'll often find many individual objects all of the same kind.  There may be thousands of other bicycles in existence, all of the same make and model.  Each bicycle was built from the same set of blueprints and therefore contains the same components.  In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles 7
  • 8. Class by Example Syntax modifier class myClass { //class header //field, constructor //method declarations } public class Dog { String breed; int age; String color; void barking() { } void hungry() { } void sleeping() { } } 8
  • 9. Abstraction 9  Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.  In java, we use abstract class and interface to achieve abstraction. Example  Let's take one real life 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 you do not know its internal details, 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.  Thus, we can say a television clearly separates its internal implementation from its external interface and you can play with its interfaces like the power button, channel changer, and volume control without having any knowledge of its internals.
  • 10. Encapsulation 10  Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines.  A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private here.
  • 11. Inheritance?  When one object acquires all the properties and behaviors of parent object i.e. known as inheritance.  It provides code reusability. It is used to achieve runtime polymorphism.  Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. 11
  • 12. Inheritance? In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses: 12
  • 13. Inheriting Syntax  The syntax for creating a subclass is simple.  At the beginning of your class declaration, use the extends keyword, followed by the name of the class to inherit from: class MountainBike extends Bicycle { // new fields and methods defining // a mountain bike would go here } 13
  • 14. Interface?  An interface is a group of related methods with empty bodies.  Methods form the object's interface with the outside world; the buttons on the front of your television set, for example, are the interface between you and the electrical wiring on the other side of its plastic casing. You press the "power" button to turn the television on and off.  Interfaces form a contract between the class and the outside world, and this contract is enforced at build time by the compiler. 14
  • 15. Interface?  The interface in java is a mechanism to achieve fully abstraction.  There can be only abstract methods in the java interface not method body.  It is used to achieve fully abstraction and multiple inheritance in Java.  Java Interface also represents IS-A relationship.  It cannot be instantiated just like abstract class. 15
  • 16. Package?  A package is a namespace that organizes a set of related classes and interfaces.  Conceptually you can think of packages as being similar to different folders on your computer.  The Java platform provides an enormous class library (a set of packages) suitable for use in your own applications. This library is known as the "Application Programming Interface", or "API" for short.  Its packages represent the tasks most commonly associated with general-purpose programming. 16
  • 17. Polymorphism?  When one task is performed by different ways i.e. known as polymorphism. For example: to convince the customer differently, to draw something e.g. shape or rectangle etc.  In java, we use method overloading and method overriding to achieve polymorphism.  Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc. 17
  • 18. 18