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
Give the difference between the println method and sqrt method?
What is pass by value?
What is difference between fileinputstream and filereader in java?
What about abstract classes in java?
What is the similarity between dynamic binding and linking?
How do you make a thread in java?
How do you use find and replace?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What is the effect of keeping a constructor private?
why java uses class level type casting ?
Is null a string?
What is java english?
Why collection is called framework in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is flag in python?