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 does opcode mean?

1096


What is an example of a conditional statement?

1066


Explain the term virtual machine?

1058


Explain about method local inner classes or local inner classes in java?

1042


What are scriptlets?

1101


What is the use of StringTokenizer class?

1078


What are the differences between forwarding () method and sendredirect() methods?

1124


Is empty list java?

939


What do you mean by JVM?

1095


Difference between current previous versions of Java?

1038


Is char a data type in java?

985


Which class cannot be a subclass in java?

1034


Explain about core java?

1142


What is a constructor overloading in java?

1054


How infinite loop is declared?

1037