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 is args length in java?
What about interthread communication and how it takes place in java?
Why do you canvas?
What is the difference between a loader and a compiler?
What is the difference between preemptive scheduling and time slicing?
How to stop a thread in java? Explain about sleep () method in a thread?
What is the primitive type byte?
What are pass by reference and pass by value?
How can we find the actual size of an object on the heap?
What is the syntax and characteristics of a lambda expression? Explain
Can a static class have a constructor?
What is thread start?
What is nan in java?
Why is it called boolean?
Similarity and difference between static block and static method ?