There are 2 classes, 1 LandAnimal and another WaterAnimal.
There is another class Animal which wants to have the
properties of both LandAnimal and WaterAnimal. How will you
design this situation?
Answer Posted / vikneswarank
class LandAnimal
{
//some code here
}
class WaterAnimal extends LandAnimal
{
//soma code here
}
class Animal extends landAnimal
{
// here we can access properties both class
}
| Is This Answer Correct ? | 2 Yes | 19 No |
Post New Answer View All Answers
What is exception handling in java?
How do you represent a space in regex java?
Does java arraylist maintain insertion order?
Explain java heap space and garbage collection?
Can we override constructor in java?
Is string an object?
Differentiate between array list and vector in java.
How a variable is stored in memory?
What are the differences between c++ and java?
What do you mean by synchronized non access modifier?
What language is pass by reference?
What is widening and narrowing in java? Discuss with an example.
What is difference between call by value and call by reference?
What is this keyword in java?
What is an example of procedure?