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 / kash
@ Bhaskr Reddy
The only problem I see with your solution is when I want to create the object Animal which has to implement properties from both WaterAnimal and LandAnumal: How will I create an instance of of class Animal which implements both the interfaces at the same time?
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain with example the concept of constant variable in java.
Can a final variable be initialized in constructor?
Can we make main() thread as daemon?
What are unchecked exceptions in java?
What is a null point?
What is a parameter in java?
Can we use synchronized block for primitives?
Explain the private field modifier?
What happens if we override only equals?
Is java owned by oracle?
Which arithmetic operations can result in the throwing of an arithmeticexception?
Write a java program that prints all the values given at command-line.
what is a thread pool in java and why is it used?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
Why there are some null interface in java? What does it mean?