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

Seminar on java
Seminar on javaSeminar on java
Seminar on javashathika
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functionsHarsh Patel
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.MASQ Technologies
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 
Serialization in java
Serialization in javaSerialization in java
Serialization in javaJanu Jahnavi
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
Inheritance
InheritanceInheritance
InheritanceTech_MX
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functionsMarlom46
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsNilesh Dalvi
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logicJanet Stemwedel
 

What's hot (20)

Seminar on java
Seminar on javaSeminar on java
Seminar on java
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
Serialization in java
Serialization in javaSerialization in java
Serialization in java
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Abstract class
Abstract classAbstract class
Abstract class
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
class and objects
class and objectsclass and objects
class and objects
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 

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
 
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
 
Principles of Object Oriented Programming
Principles of Object Oriented ProgrammingPrinciples of Object Oriented Programming
Principles of Object Oriented Programming
 

Recently uploaded

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 

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