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 is deserialization?

1031


What is final modifier?

1060


What is the constructor?

1061


Are registers volatile?

938


What is hash table in java?

1028


What is <> used for in java?

1118


Difference between concurrent hashmap and hashtable and collections

1070


What is bytecode verifier?

949


Can we create a class inside a class in java?

1086


Why does java not allow multiple public classes in a java file ?

4550


What restrictions are placed on method overloading in java programming?

1053


Why do we need data serialization?

998


Is singleton class thread safe?

1001


Define max and min heap, also the search time of heap.

1030


Can I declare a class as private?

1089