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 / abdul

class WaterAnimal
{
// code
}
class LandAnimal extends WaterAnimal
{
//This class has WaterAnimal properties
}
class Animal extends LandAnimal
{
//This class has both LandAnimal and WaterAnimal properties
}

Is This Answer Correct ?    10 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we clone singleton object?

1128


Does google use java?

1019


What are abstract methods in java?

1173


When does an object becomes eligible for garbage collection in java?

1138


What is singleton class example?

1087


What are the differences between this and super keyword?

988


Explain wait(), notify() and notifyall() methods of object class ?

1117


Explain about abstract classes in java?

1091


What is the final class?

1129


What is command line argument

1245


What is slash r?

1064


How can an exception be thrown manually by a programmer?

1054


give an example for encapsulation?

1095


What is parameter example?

1077


What is meant by data hiding in java?

1221