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 / suganya from tamilnadu
class Animal
{
// code
}
class LandAnimal extends Animal
{
//This class has WaterAnimal properties
}
class WaterAnimal extends Animal
{
//This class has both LandAnimal and WaterAnimal properties
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What does opcode mean?
What is an example of a conditional statement?
Explain the term virtual machine?
Explain about method local inner classes or local inner classes in java?
What are scriptlets?
What is the use of StringTokenizer class?
What are the differences between forwarding () method and sendredirect() methods?
Is empty list java?
What do you mean by JVM?
Difference between current previous versions of Java?
Is char a data type in java?
Which class cannot be a subclass in java?
Explain about core java?
What is a constructor overloading in java?
How infinite loop is declared?