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 extension method in java?
What does escaping a character mean?
How do you create an array in java?
What are JVM.JRE, J2EE, JNI?
What is the locale class in java programming?
What does jre stand for?
Can a method be overloaded based on different return type but same argument type?
What is stream api in java8?
Explain the importance of finally block in java?
If two threads have same priority which thread will be executed first ?
What do you mean by global variable?
what happens when a thread cannot acquire a lock on an object? : Java thread
Which is better singleton or static class?
Is string is a data type in java?
Explain about the interpreter in java?