SlideShare a Scribd company logo
1 of 22
QUICK REVISION GUIDE – THEORY PORTION
MODULE

ELEMENTARY CONCEPTS OF
OBJECTS AND CLASSES

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
TOPICS TO REVISE







class
object
abstraction
encapsulation
inheritance
polymorphism

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
 Definition of a class in OOP

 Definition of a class in the real world
 Example of a classes and objects in the

real world
 Format of defining a class
 Attributes required for defining a class
 members of a class
i) instance variable/member
variable/data member / fields
ii) class variable / static variable
iii) constructor
OBJECT











definition of object in the real world
Definition of object in OOP
Example of an object in the real world with
characteristics and behaviour
Characteristics / state of an object
Behaviiour of an object
format of object declaration
Format of object creation
memory allocation of an object
referencing members of a class using an object
representing real world objects in object
oriented programming

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
ABSTRACTION
 Abstraction is the act of representing




essential features of a system without
including the background details or
explanations
Example of abstraction in the real world
Example of abstraction in OOP

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
ENCAPSULATION
 The wrapping up of data and the related


functions into a single unit called class is
known as encapsulation.
Data hiding /Information hiding
preventing unauthorized accessing of data
from outside the class using the principle of
encapsulation and private access modifier is
called data hiding

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
INHERITANCE







Definition
Need for Inheritance
base class and derived class
Different forms of inheritance
- types of inheritance supported by
java
Use of key words extends and super
Function overriding

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Definition
 Inheritance is the process by which
a class acquires the properties of
another class.

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Advantages of inheritance

 help us to express inheritance



relationship which ensures
closeness with real-world
models
reusability of existing classes

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Base class and Derived class

class A

base class
class B

derived class

 base class is the class from which
properties are acquired. It is also called
super class or parent class
Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Base class and derived class
class A

base class
class B



derived class

derived class is the class that acquire
properties from another class. It is also
called sub class or child class or
extended class

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Different forms of inheritance
single inheritance
class A

class B

A sub class inherits only from a base class

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Different forms of inheritance
multilevel inheritance
class A

class B

a sub class
inherits from a
class that itself
inherits from
another class

class C

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Different forms of inheritance
multiple inheritance
class A

class B

class C

a class is derived
from two or more
Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
base classes
Applications Students
Different forms of inheritance
hybrid inheritance
class A

class B

class C

class D
a class acquires
properties from
another class
through two or more
paths
Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Different forms of inheritance
hierarchical inheritance
class A

class B

class C

class D

a class has
several sub
classes
Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Use of access modifiers in
Inheritance

 private members of a class can



be used only with in the class
members of a class with default
access can be used with in the
class as well as in all the classes
with in the same package

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
Use of access modifiers in
Inheritance

 protected members of a class can



be used with in the class, in a
class of the same package as
well as in a sub class. The sub
class may be in
the same package or in a
different package
public members of a class can be
used everywhere

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
private access
modifier
yes
no
no
no
no

default access
modifier
yes
yes
yes
no
no

protected
access
modifier
public access
modifier
yes
yes
yes
yes
no

yes
yes
yes
yes
yes

19

can be
accessed with
in the class
can be
accessed in a
sub class of
same package
can be
accessed in a
class of same
package
can be
accessed in a
sub class of a
different
can be
accessed in a
class of
another

access
modifier of
member
variable /
member
function
POLYMORPHISM



Polymorphism comes from Greek
meaning “many forms.”
Polymorphism is the process by which
the same message can be given to
objects of different classes and each
object responds to this message in a
different manner depending on its class.

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
POLYMORPHISM





passing a message to an object is same as
calling a function using an object.
for e.g: String s1=s.substring(5,8);
In the above statement we invoke the
substring function of class string using the
object s1.
We can also say that we pass a message
substring to the object s1 with the values 5
and 8

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students
POLYMORPHISM

 Function overloading can be considered



as an example of polymorphism
Binding
- dynamic binding or late binding
- static binding or early binding

Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
Applications Students

More Related Content

What's hot

C++ language basic
C++ language basicC++ language basic
C++ language basicWaqar Younis
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++KAUSHAL KUMAR JHA
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CPrabu U
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionPritom Chaki
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ reportvikram mahendra
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
this keyword in Java.pptx
this keyword in Java.pptxthis keyword in Java.pptx
this keyword in Java.pptxParvizMirzayev2
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaShravan Sanidhya
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
Inheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaInheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaMananPasricha
 
Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer   Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer Ashim Lamichhane
 

What's hot (20)

Oop basic overview
Oop basic overviewOop basic overview
Oop basic overview
 
Operators in java
Operators in javaOperators in java
Operators in java
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 
Summer Training Project On C++
Summer Training Project On  C++Summer Training Project On  C++
Summer Training Project On C++
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to C
 
Constructors & Destructors
Constructors  & DestructorsConstructors  & Destructors
Constructors & Destructors
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
Inline functions
Inline functionsInline functions
Inline functions
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
this keyword in Java.pptx
this keyword in Java.pptxthis keyword in Java.pptx
this keyword in Java.pptx
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Inheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan PasrichaInheritance in c++ by Manan Pasricha
Inheritance in c++ by Manan Pasricha
 
Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer   Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer
 

Viewers also liked

Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)
Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)
Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)Olfa Hamdi
 
The great shale-gas rush new product developement
The great shale-gas rush new product developementThe great shale-gas rush new product developement
The great shale-gas rush new product developementGaurav Singh
 
+Data analysis using tableau
+Data analysis using tableau+Data analysis using tableau
+Data analysis using tableauGaurav Singh
 
Ed spark 14 final 2
Ed spark 14 final 2Ed spark 14 final 2
Ed spark 14 final 2drgdavid
 
Collaboration software
Collaboration softwareCollaboration software
Collaboration softwaresmithaleesha
 
Value stream at aurangabad electricals ltd
Value stream at  aurangabad electricals ltdValue stream at  aurangabad electricals ltd
Value stream at aurangabad electricals ltdGaurav Singh
 
Towards a new paradigm of ir strategy
Towards a new paradigm of ir strategyTowards a new paradigm of ir strategy
Towards a new paradigm of ir strategyGaurav Singh
 
GANGA THE POLLUTED PURIFIER
GANGA THE POLLUTED PURIFIERGANGA THE POLLUTED PURIFIER
GANGA THE POLLUTED PURIFIERUdit Arora
 
Document management systems
Document management systemsDocument management systems
Document management systemssmithaleesha
 
Synthetic chromosome seminar
Synthetic chromosome seminarSynthetic chromosome seminar
Synthetic chromosome seminarpoornima R N
 
Casting the vision for team usa
Casting the vision for team usaCasting the vision for team usa
Casting the vision for team usacoach247
 
Supply chain at hewlett packard
Supply chain at hewlett packardSupply chain at hewlett packard
Supply chain at hewlett packardGaurav Singh
 
Fairclough et al, critical discourse analysis
Fairclough et al, critical discourse analysisFairclough et al, critical discourse analysis
Fairclough et al, critical discourse analysisSamira Rahmdel
 
Quimica recurso didactico_b4_090913
Quimica recurso didactico_b4_090913Quimica recurso didactico_b4_090913
Quimica recurso didactico_b4_090913Fabián Román
 
Discourse analysis (Schmitt's book chapter 4)
Discourse analysis (Schmitt's book chapter 4)Discourse analysis (Schmitt's book chapter 4)
Discourse analysis (Schmitt's book chapter 4)Samira Rahmdel
 

Viewers also liked (17)

ITFT - Oops
ITFT - OopsITFT - Oops
ITFT - Oops
 
Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)
Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)
Advanced Work Packaging (AWP): An Illustration of the Mortar Concept(c)
 
The great shale-gas rush new product developement
The great shale-gas rush new product developementThe great shale-gas rush new product developement
The great shale-gas rush new product developement
 
+Data analysis using tableau
+Data analysis using tableau+Data analysis using tableau
+Data analysis using tableau
 
Ed spark 14 final 2
Ed spark 14 final 2Ed spark 14 final 2
Ed spark 14 final 2
 
Collaboration software
Collaboration softwareCollaboration software
Collaboration software
 
Value stream at aurangabad electricals ltd
Value stream at  aurangabad electricals ltdValue stream at  aurangabad electricals ltd
Value stream at aurangabad electricals ltd
 
Towards a new paradigm of ir strategy
Towards a new paradigm of ir strategyTowards a new paradigm of ir strategy
Towards a new paradigm of ir strategy
 
Crm software
Crm softwareCrm software
Crm software
 
GANGA THE POLLUTED PURIFIER
GANGA THE POLLUTED PURIFIERGANGA THE POLLUTED PURIFIER
GANGA THE POLLUTED PURIFIER
 
Document management systems
Document management systemsDocument management systems
Document management systems
 
Synthetic chromosome seminar
Synthetic chromosome seminarSynthetic chromosome seminar
Synthetic chromosome seminar
 
Casting the vision for team usa
Casting the vision for team usaCasting the vision for team usa
Casting the vision for team usa
 
Supply chain at hewlett packard
Supply chain at hewlett packardSupply chain at hewlett packard
Supply chain at hewlett packard
 
Fairclough et al, critical discourse analysis
Fairclough et al, critical discourse analysisFairclough et al, critical discourse analysis
Fairclough et al, critical discourse analysis
 
Quimica recurso didactico_b4_090913
Quimica recurso didactico_b4_090913Quimica recurso didactico_b4_090913
Quimica recurso didactico_b4_090913
 
Discourse analysis (Schmitt's book chapter 4)
Discourse analysis (Schmitt's book chapter 4)Discourse analysis (Schmitt's book chapter 4)
Discourse analysis (Schmitt's book chapter 4)
 

Similar to Module1 elementary concepts of objects and classes

Similar to Module1 elementary concepts of objects and classes (20)

Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Inheritance and its necessity in java.ppt
Inheritance and its necessity in java.pptInheritance and its necessity in java.ppt
Inheritance and its necessity in java.ppt
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
 
Ap Power Point Chpt7
Ap Power Point Chpt7Ap Power Point Chpt7
Ap Power Point Chpt7
 
Inheritance used in java
Inheritance used in javaInheritance used in java
Inheritance used in java
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Unit 3 Java
Unit 3 JavaUnit 3 Java
Unit 3 Java
 
INHERITANCE-Oopc ppt-ta4
INHERITANCE-Oopc ppt-ta4INHERITANCE-Oopc ppt-ta4
INHERITANCE-Oopc ppt-ta4
 
INHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptxINHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptx
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
 
Eo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5eEo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5e
 
Eo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5eEo gaddis java_chapter_09_5e
Eo gaddis java_chapter_09_5e
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
 
Multiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptxMultiple inheritance in java3 (1).pptx
Multiple inheritance in java3 (1).pptx
 
inheritance_in_java_object_oriented_programming.pptx
inheritance_in_java_object_oriented_programming.pptxinheritance_in_java_object_oriented_programming.pptx
inheritance_in_java_object_oriented_programming.pptx
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Module1 elementary concepts of objects and classes

  • 1. QUICK REVISION GUIDE – THEORY PORTION MODULE ELEMENTARY CONCEPTS OF OBJECTS AND CLASSES Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer
  • 2. TOPICS TO REVISE       class object abstraction encapsulation inheritance polymorphism Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 3.  Definition of a class in OOP  Definition of a class in the real world  Example of a classes and objects in the real world  Format of defining a class  Attributes required for defining a class  members of a class i) instance variable/member variable/data member / fields ii) class variable / static variable iii) constructor
  • 4. OBJECT           definition of object in the real world Definition of object in OOP Example of an object in the real world with characteristics and behaviour Characteristics / state of an object Behaviiour of an object format of object declaration Format of object creation memory allocation of an object referencing members of a class using an object representing real world objects in object oriented programming Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 5. ABSTRACTION  Abstraction is the act of representing   essential features of a system without including the background details or explanations Example of abstraction in the real world Example of abstraction in OOP Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 6. ENCAPSULATION  The wrapping up of data and the related  functions into a single unit called class is known as encapsulation. Data hiding /Information hiding preventing unauthorized accessing of data from outside the class using the principle of encapsulation and private access modifier is called data hiding Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 7. INHERITANCE       Definition Need for Inheritance base class and derived class Different forms of inheritance - types of inheritance supported by java Use of key words extends and super Function overriding Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 8. Definition  Inheritance is the process by which a class acquires the properties of another class. Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 9. Advantages of inheritance  help us to express inheritance  relationship which ensures closeness with real-world models reusability of existing classes Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 10. Base class and Derived class class A base class class B derived class  base class is the class from which properties are acquired. It is also called super class or parent class Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 11. Base class and derived class class A base class class B  derived class derived class is the class that acquire properties from another class. It is also called sub class or child class or extended class Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 12. Different forms of inheritance single inheritance class A class B A sub class inherits only from a base class Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 13. Different forms of inheritance multilevel inheritance class A class B a sub class inherits from a class that itself inherits from another class class C Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 14. Different forms of inheritance multiple inheritance class A class B class C a class is derived from two or more Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer base classes Applications Students
  • 15. Different forms of inheritance hybrid inheritance class A class B class C class D a class acquires properties from another class through two or more paths Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 16. Different forms of inheritance hierarchical inheritance class A class B class C class D a class has several sub classes Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 17. Use of access modifiers in Inheritance  private members of a class can  be used only with in the class members of a class with default access can be used with in the class as well as in all the classes with in the same package Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 18. Use of access modifiers in Inheritance  protected members of a class can  be used with in the class, in a class of the same package as well as in a sub class. The sub class may be in the same package or in a different package public members of a class can be used everywhere Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 19. private access modifier yes no no no no default access modifier yes yes yes no no protected access modifier public access modifier yes yes yes yes no yes yes yes yes yes 19 can be accessed with in the class can be accessed in a sub class of same package can be accessed in a class of same package can be accessed in a sub class of a different can be accessed in a class of another access modifier of member variable / member function
  • 20. POLYMORPHISM   Polymorphism comes from Greek meaning “many forms.” Polymorphism is the process by which the same message can be given to objects of different classes and each object responds to this message in a different manner depending on its class. Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 21. POLYMORPHISM     passing a message to an object is same as calling a function using an object. for e.g: String s1=s.substring(5,8); In the above statement we invoke the substring function of class string using the object s1. We can also say that we pass a message substring to the object s1 with the values 5 and 8 Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students
  • 22. POLYMORPHISM  Function overloading can be considered  as an example of polymorphism Binding - dynamic binding or late binding - static binding or early binding Prepared by Merson Mathew, St. Joseph’s School Bhagalpur for ICSE Computer Applications Students

Editor's Notes

  1. To completeJames goslingExample of appelet