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 / vikneswarank
class LandAnimal
{
//some code here
}
class WaterAnimal extends LandAnimal
{
//soma code here
}
class Animal extends landAnimal
{
// here we can access properties both class
}
| Is This Answer Correct ? | 2 Yes | 19 No |
Post New Answer View All Answers
What is the scope or life time of instance variables?
How java is similar to c?
What is callable java?
How do you do a line break in java?
Write a program to check for a prime number in java?
What is stringjoiner ?
How do you do absolute value in java?
How do you define a parameter?
What is the flag in java?
What is consumer in java?
What kind of variables a class can consist of?
How we can generate random numbers in java?
What are the restriction imposed on a static method or a static block of code?
What is an example of a conditional statement?
Is there any difference between synchronized methods and synchronized statements?