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

Hybrid electric vehicle Seminar Presentation
Hybrid electric vehicle Seminar PresentationHybrid electric vehicle Seminar Presentation
Hybrid electric vehicle Seminar PresentationLakshminarayan Solanki
 
Hybrid electric vehicle
Hybrid electric vehicleHybrid electric vehicle
Hybrid electric vehicleganeshbehera6
 
Types of computer
Types of computerTypes of computer
Types of computerOnline
 
software development and programming languages
software development and programming languages software development and programming languages
software development and programming languages PraShant Kumar
 
What is Application Software?
What is Application Software?What is Application Software?
What is Application Software?DaisyJeffenYRios
 
Characteristics of Computers
Characteristics of ComputersCharacteristics of Computers
Characteristics of Computerspathumbee
 
Functional units of computer
Functional units of computerFunctional units of computer
Functional units of computergaurav jain
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
Foot step power generation(REPORT) ..pdf
Foot step power generation(REPORT) ..pdfFoot step power generation(REPORT) ..pdf
Foot step power generation(REPORT) ..pdfansari masroof
 
Computer Fundamental
Computer FundamentalComputer Fundamental
Computer Fundamentalactanimation
 
Electric hybrid vehicle Seminar Report
Electric hybrid vehicle Seminar ReportElectric hybrid vehicle Seminar Report
Electric hybrid vehicle Seminar ReportLakshminarayan Solanki
 
Hardware & software
Hardware & softwareHardware & software
Hardware & softwareIsabelop
 

What's hot (20)

Boolean algebra & logic gates
Boolean algebra & logic gatesBoolean algebra & logic gates
Boolean algebra & logic gates
 
Hybrid electric vehicle Seminar Presentation
Hybrid electric vehicle Seminar PresentationHybrid electric vehicle Seminar Presentation
Hybrid electric vehicle Seminar Presentation
 
Hybrid electric vehicle
Hybrid electric vehicleHybrid electric vehicle
Hybrid electric vehicle
 
Graphical programming
Graphical programmingGraphical programming
Graphical programming
 
Types of computer
Types of computerTypes of computer
Types of computer
 
software development and programming languages
software development and programming languages software development and programming languages
software development and programming languages
 
What is Application Software?
What is Application Software?What is Application Software?
What is Application Software?
 
computer Architecture
computer Architecturecomputer Architecture
computer Architecture
 
Characteristics of Computers
Characteristics of ComputersCharacteristics of Computers
Characteristics of Computers
 
Functional units of computer
Functional units of computerFunctional units of computer
Functional units of computer
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Qbasic
QbasicQbasic
Qbasic
 
Number system
Number systemNumber system
Number system
 
Foot step power generation(REPORT) ..pdf
Foot step power generation(REPORT) ..pdfFoot step power generation(REPORT) ..pdf
Foot step power generation(REPORT) ..pdf
 
Computer Fundamental
Computer FundamentalComputer Fundamental
Computer Fundamental
 
Electric hybrid vehicle Seminar Report
Electric hybrid vehicle Seminar ReportElectric hybrid vehicle Seminar Report
Electric hybrid vehicle Seminar Report
 
Memory devices
Memory devicesMemory devices
Memory devices
 
Hardware & software
Hardware & softwareHardware & software
Hardware & software
 
Presentation on Programming Languages.
Presentation on Programming Languages.Presentation on Programming Languages.
Presentation on Programming Languages.
 
Differences between c and c++
Differences between c and c++Differences between c and c++
Differences between c and c++
 

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

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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 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
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 

Recently uploaded (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
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
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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 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
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.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