SlideShare a Scribd company logo
Inheritance question class 12th
GET 100% MARKS IN
COMPUTER SCIENCE
TOPIC COVERED : QUESTION BASED ON
INHERITANCE
IN THIS PART 4 TYPE OF QUESTIONS CAN BE
FORMED IN YOUR EXAM
1. To Identify the type of inheritance in the given question
2. To identify the members accessible through an object
3. To identify the members accessible through a member function
4. To calculate size of any class
3 TERMS CAN BE USED IN THIS
TYPE OF QUESTION
DATA MEMBERS MEMBER
FUNCTIONS/METHODS
MEMBERS
DATA MEMBERS REFERS TO
THE VARABLES DECARED
WITHIN CLASS
MEMBER
FUNCTION/METHOD REFERS
TO THE FUNCTION WITHIN
CLASS
MEMBERS REFERS TO BOTH
VARABLES AND FUNCTIONS
DECARED WITHIN CLASS
Q.1 IDENTIFY TYPE OF INHERITANCE
TYPES OF INHERITANCE IN C++ ARE
1.) SINGLE
2.) MULTIPLE
3.) MULTILEVEL
4.) HIERARICHAL
5.) HYBRID
LET’S UNDERSTAND TYPE OF INHERITANCE THROUGH THE MEAN
OF DIAGRAMS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
SINGLE INHERITANCE
BASE/PARENT/
SUPER CLASS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
MULTIPLE INHERITANCE
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
HIERARICHAL INHERITANCE
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
MULTILEVEL INHERITANCE
BASE/PARENT/
SUPER CLASS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
HYBRID INHERITANCE
Q.2TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH AN OB
RULES TO SOLUTION
RULE 1: AN OBJECT CAN ACCESS ONLY PUBLIC MEMBERS OF ITS OWN CLASS.
RULE 2 : AN OBJECT CAN ACCESS PUBLIC MEMBERS OF IT’S PARENT/SUPER CLASS
BUT THE MODE OF INHERITANCE SHOULD BE PUBLIC ONLY.
Q.3.TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH A
MEMBER FUNCTION
RULES TO SOLVE IT EASILY
RULE 1: A MEMBER FUNCTION CAN ACCESS ALL MEMVERS/DATA OF ITS OWN
CLASS.
RULE 2 : A MEMBERS FUNCTION CAN ACCESS ONLY PUBLIC AND PROTECTED OF
SUPER/PARENT CLASS IN ANY MODE OF INHERITANCE.
Q.4. CALCULATE SIZE OF A CLASS
• SIZE OF ANY CLASS = SIZE OF THAT CLASS + SIZE OF ITS PARENT CLASSES
• TO CALCULATE SIZE OF ANY PARTICULAR CLASS JUST ADD SIZE OF ALL IT’S
DATA MEMBERS
SIZE OF SOME DATA TYPES
INTEGER : 2 BYTES
CHARACTER : 1 BYTE
FLOAT : 4 BYTES
LONG : 8 BYTES
DOUBLE : 8 BYTES
Note: You have to count size of all data
members(variables) including public,
private and protected section variables.
CLASS A
CLASS B
CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
SIZE OF CLASS B
+
SIZE OF CLASS A
+
SIZE OF CLASS C
CLASS A CLASS B
CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS
B ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
+
SIZE OF CLASS C
CLASS A
CLASS B CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
SIZE OF CLASS C
+
SIZE OF CLASS A
THANKS FOR WATCHING MY PPT
AND PLEASE DON’T FORGOT TO LIKE
SUBSCRIBE AND DO COMMENTS IF YOU HAVE
ANY QUERY AND IF YOU LIKE THE PPT
EMAIL : theaakashkumar@gmail.com

More Related Content

PPT
Chapter 03
PDF
ISRO - Computer Science - 2007 - Question Paper - TheOnlineMaterial.Blogspot.com
PPTX
C++ programming Unit 5 flow of control
PPT
Ms word Part 2
PPTX
c++ programming Unit 3 variables,data types
PPT
Introduction to method overloading & method overriding in java hdm
PDF
itft-Inheritance in java
Chapter 03
ISRO - Computer Science - 2007 - Question Paper - TheOnlineMaterial.Blogspot.com
C++ programming Unit 5 flow of control
Ms word Part 2
c++ programming Unit 3 variables,data types
Introduction to method overloading & method overriding in java hdm
itft-Inheritance in java

Viewers also liked (14)

PDF
Inheritance and Method Overriding
PDF
OOP Inheritance
PPTX
Multiple inheritance possible in Java
PPTX
c++ programming Unit 1 introduction to c++
PPT
Inheritance, polymorphisam, abstract classes and composition)
PPT
Oop Presentation
PDF
Chapter2 Encapsulation (Java)
PPTX
Flavor encapsulation assignment
PPTX
Object Orinted Programing(OOP) concepts \
PPTX
Inheritance in JAVA PPT
PPTX
Inheritance
PDF
CBSE XII Communication And Network Concepts
PPT
20. Object-Oriented Programming Fundamental Principles
PPTX
Constructor in java
Inheritance and Method Overriding
OOP Inheritance
Multiple inheritance possible in Java
c++ programming Unit 1 introduction to c++
Inheritance, polymorphisam, abstract classes and composition)
Oop Presentation
Chapter2 Encapsulation (Java)
Flavor encapsulation assignment
Object Orinted Programing(OOP) concepts \
Inheritance in JAVA PPT
Inheritance
CBSE XII Communication And Network Concepts
20. Object-Oriented Programming Fundamental Principles
Constructor in java
Ad

Similar to Inheritance question class 12th (20)

PPTX
Intro To C++ - Class #22: Inheritance, Part 1
PPTX
Chapter - 1.pptx
DOCX
Student Name Daniel RosadoCourseCIS339Session (month, ye.docx
PPTX
Introduction to C++
DOCX
Themes to be Included1)      Afrikan Ethnic Groups         .docx
PPT
Inheritance & Polymorphism - 1
DOCX
Critique of an ArticleQUESTIONS TO ASK WHILE READING A RESEARCH .docx
PPSX
Seminar on java
PPTX
Inheritance in c++
PDF
School Software Students information
DOCX
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docx
PPTX
ACCESS SPECIFIERS AND ACCESS MODIFIERS IN C#.pptx
DOCX
Part AExplain why access modifiers are necessary for any class b.docx
PPTX
inheritance_OOPC_datastream.ppttttttttttttttx
PPTX
CC - 6 Mitali Mallik - Sampling Methods.pptx
DOCX
Student Records System SRS – Requirements DefinitionsNon.docx
PPTX
object oriented programming unit two ppt
PDF
Curriculum evaluation through learning assessment
PPTX
) Function overriding, Member Classes Nesting of Classes.pptx
DOCX
LearnersThis announcement item concerns discussions activity .docx
Intro To C++ - Class #22: Inheritance, Part 1
Chapter - 1.pptx
Student Name Daniel RosadoCourseCIS339Session (month, ye.docx
Introduction to C++
Themes to be Included1)      Afrikan Ethnic Groups         .docx
Inheritance & Polymorphism - 1
Critique of an ArticleQUESTIONS TO ASK WHILE READING A RESEARCH .docx
Seminar on java
Inheritance in c++
School Software Students information
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docx
ACCESS SPECIFIERS AND ACCESS MODIFIERS IN C#.pptx
Part AExplain why access modifiers are necessary for any class b.docx
inheritance_OOPC_datastream.ppttttttttttttttx
CC - 6 Mitali Mallik - Sampling Methods.pptx
Student Records System SRS – Requirements DefinitionsNon.docx
object oriented programming unit two ppt
Curriculum evaluation through learning assessment
) Function overriding, Member Classes Nesting of Classes.pptx
LearnersThis announcement item concerns discussions activity .docx
Ad

More from AAKASH KUMAR (20)

PPTX
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
PPTX
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
PPTX
Inheritance question
PPTX
Header file BASED QUESTION- CBSE CS CLASS 12TH
PPTX
Constructor & destructor based question- cbse cs class 12th
PPTX
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
PPTX
Practical exam special- CBSE CS CLASS 12th
PPTX
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
PPTX
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
PPTX
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
PPT
Ms word Part 1
PPTX
Power point2007instruction
PPT
Html introduction Part-2
PPT
Html Slide Part-1
PPT
Evolution / history of Computer
PPTX
computer system
PPTX
Array within a class
PPTX
Input Output Devices and Memory Unit
PPTX
c++ programming Unit 4 operators
PPTX
c++ programming Unit 2 basic structure of a c++ program
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
Inheritance question
Header file BASED QUESTION- CBSE CS CLASS 12TH
Constructor & destructor based question- cbse cs class 12th
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
Practical exam special- CBSE CS CLASS 12th
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
Ms word Part 1
Power point2007instruction
Html introduction Part-2
Html Slide Part-1
Evolution / history of Computer
computer system
Array within a class
Input Output Devices and Memory Unit
c++ programming Unit 4 operators
c++ programming Unit 2 basic structure of a c++ program

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Insiders guide to clinical Medicine.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Types and Its function , kingdom of life
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
Pre independence Education in Inndia.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
2.FourierTransform-ShortQuestionswithAnswers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
O7-L3 Supply Chain Operations - ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
TR - Agricultural Crops Production NC III.pdf
GDM (1) (1).pptx small presentation for students
Insiders guide to clinical Medicine.pdf
01-Introduction-to-Information-Management.pdf
Microbial disease of the cardiovascular and lymphatic systems
Cell Types and Its function , kingdom of life
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?

Inheritance question class 12th

  • 2. GET 100% MARKS IN COMPUTER SCIENCE TOPIC COVERED : QUESTION BASED ON INHERITANCE
  • 3. IN THIS PART 4 TYPE OF QUESTIONS CAN BE FORMED IN YOUR EXAM 1. To Identify the type of inheritance in the given question 2. To identify the members accessible through an object 3. To identify the members accessible through a member function 4. To calculate size of any class
  • 4. 3 TERMS CAN BE USED IN THIS TYPE OF QUESTION DATA MEMBERS MEMBER FUNCTIONS/METHODS MEMBERS DATA MEMBERS REFERS TO THE VARABLES DECARED WITHIN CLASS MEMBER FUNCTION/METHOD REFERS TO THE FUNCTION WITHIN CLASS MEMBERS REFERS TO BOTH VARABLES AND FUNCTIONS DECARED WITHIN CLASS
  • 5. Q.1 IDENTIFY TYPE OF INHERITANCE TYPES OF INHERITANCE IN C++ ARE 1.) SINGLE 2.) MULTIPLE 3.) MULTILEVEL 4.) HIERARICHAL 5.) HYBRID
  • 6. LET’S UNDERSTAND TYPE OF INHERITANCE THROUGH THE MEAN OF DIAGRAMS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS SINGLE INHERITANCE BASE/PARENT/ SUPER CLASS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS MULTIPLE INHERITANCE BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS HIERARICHAL INHERITANCE
  • 7. BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS MULTILEVEL INHERITANCE BASE/PARENT/ SUPER CLASS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS HYBRID INHERITANCE
  • 8. Q.2TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH AN OB RULES TO SOLUTION RULE 1: AN OBJECT CAN ACCESS ONLY PUBLIC MEMBERS OF ITS OWN CLASS. RULE 2 : AN OBJECT CAN ACCESS PUBLIC MEMBERS OF IT’S PARENT/SUPER CLASS BUT THE MODE OF INHERITANCE SHOULD BE PUBLIC ONLY.
  • 9. Q.3.TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH A MEMBER FUNCTION RULES TO SOLVE IT EASILY RULE 1: A MEMBER FUNCTION CAN ACCESS ALL MEMVERS/DATA OF ITS OWN CLASS. RULE 2 : A MEMBERS FUNCTION CAN ACCESS ONLY PUBLIC AND PROTECTED OF SUPER/PARENT CLASS IN ANY MODE OF INHERITANCE.
  • 10. Q.4. CALCULATE SIZE OF A CLASS • SIZE OF ANY CLASS = SIZE OF THAT CLASS + SIZE OF ITS PARENT CLASSES • TO CALCULATE SIZE OF ANY PARTICULAR CLASS JUST ADD SIZE OF ALL IT’S DATA MEMBERS SIZE OF SOME DATA TYPES INTEGER : 2 BYTES CHARACTER : 1 BYTE FLOAT : 4 BYTES LONG : 8 BYTES DOUBLE : 8 BYTES Note: You have to count size of all data members(variables) including public, private and protected section variables.
  • 11. CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B + SIZE OF CLASS A SIZE OF CLASS B + SIZE OF CLASS A + SIZE OF CLASS C CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B ONLY SIZE OF CLASS B + SIZE OF CLASS A + SIZE OF CLASS C
  • 12. CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B + SIZE OF CLASS A SIZE OF CLASS C + SIZE OF CLASS A
  • 13. THANKS FOR WATCHING MY PPT AND PLEASE DON’T FORGOT TO LIKE SUBSCRIBE AND DO COMMENTS IF YOU HAVE ANY QUERY AND IF YOU LIKE THE PPT EMAIL : theaakashkumar@gmail.com