SlideShare a Scribd company logo
1 of 2
Download to read offline
1.If we want to add a new Crow class,first of all we have to observe what is the type of Crow
class.Crow is a type of Bird.As is having the features of the Bird we have to make the Crow class
as a subclass to Bird class.
2.Actually we kept the bodyTemperature variable in Reptile class.But we know every living
thing has a body temperature.So we have to use that variable in the super class or parent class of
all the classes.
So we have to put that bodyTemperature varuable in the animal class(This is the super class of
all te classes here).So that all animals will have bodytemperature.Means the subclasses of the
Animal class like Reptile class and Bird class will have body temperature.
If we use bodyTemperature in Reptile class.We can use it only in the Reptile class and its
subclasses.We can use it the Bird Class and its sub classes.
3)If we want to make an Ostrich class as a subclass to Bird class,and also if we want to disable
the fly() method of Bird class in Ostrich class we have to override the fly() method in the Ostrich
class and we dont have to provide any implementation for that overridden fly() method .So that if
we call the fly() method in Ostrich it will not do anything or we can write
UnsupportedOperationException.
class Ostrich extends Bird
{
@Override
fly()
{
}
}
_______________( OR )___________________
class Ostrich extends Bird
{
@Override
fly()
{
UnsupportedOperationException();
}
}
_________________________________________
Solution
1.If we want to add a new Crow class,first of all we have to observe what is the type of Crow
class.Crow is a type of Bird.As is having the features of the Bird we have to make the Crow class
as a subclass to Bird class.
2.Actually we kept the bodyTemperature variable in Reptile class.But we know every living
thing has a body temperature.So we have to use that variable in the super class or parent class of
all the classes.
So we have to put that bodyTemperature varuable in the animal class(This is the super class of
all te classes here).So that all animals will have bodytemperature.Means the subclasses of the
Animal class like Reptile class and Bird class will have body temperature.
If we use bodyTemperature in Reptile class.We can use it only in the Reptile class and its
subclasses.We can use it the Bird Class and its sub classes.
3)If we want to make an Ostrich class as a subclass to Bird class,and also if we want to disable
the fly() method of Bird class in Ostrich class we have to override the fly() method in the Ostrich
class and we dont have to provide any implementation for that overridden fly() method .So that if
we call the fly() method in Ostrich it will not do anything or we can write
UnsupportedOperationException.
class Ostrich extends Bird
{
@Override
fly()
{
}
}
_______________( OR )___________________
class Ostrich extends Bird
{
@Override
fly()
{
UnsupportedOperationException();
}
}
_________________________________________

More Related Content

More from rakeshankur

b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf
                     b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf                     b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf
b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdfrakeshankur
 
The periodic table of the chemical elements (also known as the perio.pdf
The periodic table of the chemical elements (also known as the perio.pdfThe periodic table of the chemical elements (also known as the perio.pdf
The periodic table of the chemical elements (also known as the perio.pdfrakeshankur
 
The answer is c, Polonium. An alpha particle contains two protons .pdf
The answer is c, Polonium. An alpha particle contains two protons .pdfThe answer is c, Polonium. An alpha particle contains two protons .pdf
The answer is c, Polonium. An alpha particle contains two protons .pdfrakeshankur
 
Solutionclass IntNode { int data; public IntNode next,head;.pdf
Solutionclass IntNode { int data; public IntNode next,head;.pdfSolutionclass IntNode { int data; public IntNode next,head;.pdf
Solutionclass IntNode { int data; public IntNode next,head;.pdfrakeshankur
 
Answer is I, II, and V (5) .pdf
                     Answer is I, II, and V (5)                       .pdf                     Answer is I, II, and V (5)                       .pdf
Answer is I, II, and V (5) .pdfrakeshankur
 
Medical importance of bacteriaEcological importance of bacteria.pdf
Medical importance of bacteriaEcological importance of bacteria.pdfMedical importance of bacteriaEcological importance of bacteria.pdf
Medical importance of bacteriaEcological importance of bacteria.pdfrakeshankur
 
import turtleimport timeimport randomdef draw_rectangle(length.pdf
import turtleimport timeimport randomdef draw_rectangle(length.pdfimport turtleimport timeimport randomdef draw_rectangle(length.pdf
import turtleimport timeimport randomdef draw_rectangle(length.pdfrakeshankur
 
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdf
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdfEffects of NaCl Concentration on Red Blood Cell Volume A red blo.pdf
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdfrakeshankur
 
C) 0.3275SolutionC) 0.3275.pdf
C) 0.3275SolutionC) 0.3275.pdfC) 0.3275SolutionC) 0.3275.pdf
C) 0.3275SolutionC) 0.3275.pdfrakeshankur
 
ass smokeSolutionass smoke.pdf
ass smokeSolutionass smoke.pdfass smokeSolutionass smoke.pdf
ass smokeSolutionass smoke.pdfrakeshankur
 
Answer-Possible types of audit for this project1. Financial au.pdf
Answer-Possible types of audit for this project1. Financial au.pdfAnswer-Possible types of audit for this project1. Financial au.pdf
Answer-Possible types of audit for this project1. Financial au.pdfrakeshankur
 
4 1 2 3 Solution 4 1 2 3.pdf
                     4 1 2 3  Solution                     4 1 2 3.pdf                     4 1 2 3  Solution                     4 1 2 3.pdf
4 1 2 3 Solution 4 1 2 3.pdfrakeshankur
 
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdf
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdfAns to Q4.Colloid is a particular state of matter.A colloidal sy.pdf
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdfrakeshankur
 
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdf
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdfAnswer B and D.Both CTRL-Z and end break out of configuration mod.pdf
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdfrakeshankur
 
Amphipathic means that the molecule has a polar, hydrophillic end an.pdf
Amphipathic means that the molecule has a polar, hydrophillic end an.pdfAmphipathic means that the molecule has a polar, hydrophillic end an.pdf
Amphipathic means that the molecule has a polar, hydrophillic end an.pdfrakeshankur
 
Moran Enterprises Inc. (All values in $) Multi Step Income Sta.pdf
    Moran Enterprises Inc.  (All values in $)    Multi Step Income Sta.pdf    Moran Enterprises Inc.  (All values in $)    Multi Step Income Sta.pdf
Moran Enterprises Inc. (All values in $) Multi Step Income Sta.pdfrakeshankur
 

More from rakeshankur (16)

b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf
                     b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf                     b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf
b.glucose, HOCl, NaCl, MgCl2 increase in ionic ch.pdf
 
The periodic table of the chemical elements (also known as the perio.pdf
The periodic table of the chemical elements (also known as the perio.pdfThe periodic table of the chemical elements (also known as the perio.pdf
The periodic table of the chemical elements (also known as the perio.pdf
 
The answer is c, Polonium. An alpha particle contains two protons .pdf
The answer is c, Polonium. An alpha particle contains two protons .pdfThe answer is c, Polonium. An alpha particle contains two protons .pdf
The answer is c, Polonium. An alpha particle contains two protons .pdf
 
Solutionclass IntNode { int data; public IntNode next,head;.pdf
Solutionclass IntNode { int data; public IntNode next,head;.pdfSolutionclass IntNode { int data; public IntNode next,head;.pdf
Solutionclass IntNode { int data; public IntNode next,head;.pdf
 
Answer is I, II, and V (5) .pdf
                     Answer is I, II, and V (5)                       .pdf                     Answer is I, II, and V (5)                       .pdf
Answer is I, II, and V (5) .pdf
 
Medical importance of bacteriaEcological importance of bacteria.pdf
Medical importance of bacteriaEcological importance of bacteria.pdfMedical importance of bacteriaEcological importance of bacteria.pdf
Medical importance of bacteriaEcological importance of bacteria.pdf
 
import turtleimport timeimport randomdef draw_rectangle(length.pdf
import turtleimport timeimport randomdef draw_rectangle(length.pdfimport turtleimport timeimport randomdef draw_rectangle(length.pdf
import turtleimport timeimport randomdef draw_rectangle(length.pdf
 
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdf
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdfEffects of NaCl Concentration on Red Blood Cell Volume A red blo.pdf
Effects of NaCl Concentration on Red Blood Cell Volume A red blo.pdf
 
C) 0.3275SolutionC) 0.3275.pdf
C) 0.3275SolutionC) 0.3275.pdfC) 0.3275SolutionC) 0.3275.pdf
C) 0.3275SolutionC) 0.3275.pdf
 
ass smokeSolutionass smoke.pdf
ass smokeSolutionass smoke.pdfass smokeSolutionass smoke.pdf
ass smokeSolutionass smoke.pdf
 
Answer-Possible types of audit for this project1. Financial au.pdf
Answer-Possible types of audit for this project1. Financial au.pdfAnswer-Possible types of audit for this project1. Financial au.pdf
Answer-Possible types of audit for this project1. Financial au.pdf
 
4 1 2 3 Solution 4 1 2 3.pdf
                     4 1 2 3  Solution                     4 1 2 3.pdf                     4 1 2 3  Solution                     4 1 2 3.pdf
4 1 2 3 Solution 4 1 2 3.pdf
 
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdf
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdfAns to Q4.Colloid is a particular state of matter.A colloidal sy.pdf
Ans to Q4.Colloid is a particular state of matter.A colloidal sy.pdf
 
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdf
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdfAnswer B and D.Both CTRL-Z and end break out of configuration mod.pdf
Answer B and D.Both CTRL-Z and end break out of configuration mod.pdf
 
Amphipathic means that the molecule has a polar, hydrophillic end an.pdf
Amphipathic means that the molecule has a polar, hydrophillic end an.pdfAmphipathic means that the molecule has a polar, hydrophillic end an.pdf
Amphipathic means that the molecule has a polar, hydrophillic end an.pdf
 
Moran Enterprises Inc. (All values in $) Multi Step Income Sta.pdf
    Moran Enterprises Inc.  (All values in $)    Multi Step Income Sta.pdf    Moran Enterprises Inc.  (All values in $)    Multi Step Income Sta.pdf
Moran Enterprises Inc. (All values in $) Multi Step Income Sta.pdf
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
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 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
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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
 
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
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
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 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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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
 
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
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

1.If we want to add a new Crow class,first of all we have to observe.pdf

  • 1. 1.If we want to add a new Crow class,first of all we have to observe what is the type of Crow class.Crow is a type of Bird.As is having the features of the Bird we have to make the Crow class as a subclass to Bird class. 2.Actually we kept the bodyTemperature variable in Reptile class.But we know every living thing has a body temperature.So we have to use that variable in the super class or parent class of all the classes. So we have to put that bodyTemperature varuable in the animal class(This is the super class of all te classes here).So that all animals will have bodytemperature.Means the subclasses of the Animal class like Reptile class and Bird class will have body temperature. If we use bodyTemperature in Reptile class.We can use it only in the Reptile class and its subclasses.We can use it the Bird Class and its sub classes. 3)If we want to make an Ostrich class as a subclass to Bird class,and also if we want to disable the fly() method of Bird class in Ostrich class we have to override the fly() method in the Ostrich class and we dont have to provide any implementation for that overridden fly() method .So that if we call the fly() method in Ostrich it will not do anything or we can write UnsupportedOperationException. class Ostrich extends Bird { @Override fly() { } } _______________( OR )___________________ class Ostrich extends Bird { @Override fly() { UnsupportedOperationException(); } } _________________________________________ Solution
  • 2. 1.If we want to add a new Crow class,first of all we have to observe what is the type of Crow class.Crow is a type of Bird.As is having the features of the Bird we have to make the Crow class as a subclass to Bird class. 2.Actually we kept the bodyTemperature variable in Reptile class.But we know every living thing has a body temperature.So we have to use that variable in the super class or parent class of all the classes. So we have to put that bodyTemperature varuable in the animal class(This is the super class of all te classes here).So that all animals will have bodytemperature.Means the subclasses of the Animal class like Reptile class and Bird class will have body temperature. If we use bodyTemperature in Reptile class.We can use it only in the Reptile class and its subclasses.We can use it the Bird Class and its sub classes. 3)If we want to make an Ostrich class as a subclass to Bird class,and also if we want to disable the fly() method of Bird class in Ostrich class we have to override the fly() method in the Ostrich class and we dont have to provide any implementation for that overridden fly() method .So that if we call the fly() method in Ostrich it will not do anything or we can write UnsupportedOperationException. class Ostrich extends Bird { @Override fly() { } } _______________( OR )___________________ class Ostrich extends Bird { @Override fly() { UnsupportedOperationException(); } } _________________________________________