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 deserialization?
What is final modifier?
What is the constructor?
Are registers volatile?
What is hash table in java?
What is <> used for in java?
Difference between concurrent hashmap and hashtable and collections
What is bytecode verifier?
Can we create a class inside a class in java?
Why does java not allow multiple public classes in a java file ?
What restrictions are placed on method overloading in java programming?
Why do we need data serialization?
Is singleton class thread safe?
Define max and min heap, also the search time of heap.
Can I declare a class as private?