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
When should I use singleton pattern?
Is it possible to override private or static method in java?
Mention some interfaces implemented by linked list in java.
What is difference between next () and nextline () in java?
What is difference between add() and addelement() in vector?
define polymorphism in java
How do you sort a string in java?
What does flagged out mean?
Explain about class in java?
Is a class subclass of itself?
Does substring start with 0?
Why enumeration is faster than iterator?
What is the full name of java?
How do you read a char in java?
Which package is always imported by default?