Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What about interrupt() method of thread class ?

1124


What are multiple inheritances? Is it supported by java?

1007


What is the size of boolean variable?

1136


What is a predicate method?

1064


Can we have return statement in finally clause? What will happen?

1012


What is local declaration?

1037


What is an escape character in java?

1099


Explain how can you debug the Java code?

1117


What is the difference between abstract classes and interfaces?

1090


How do I start learning java?

1130


What do you mean by formatting?

1047


Differentiate between vector and array list.

1117


Which is better list or arraylist in java?

910


What are the two environment variables that must be set in order to run any java programs?

1019


What is singleton class in ruby?

1069