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 extension method in java?

1002


What does escaping a character mean?

979


How do you create an array in java?

959


What are JVM.JRE, J2EE, JNI?

1078


What is the locale class in java programming?

1034


What does jre stand for?

1020


Can a method be overloaded based on different return type but same argument type?

925


What is stream api in java8?

1110


Explain the importance of finally block in java?

923


If two threads have same priority which thread will be executed first ?

1443


What do you mean by global variable?

921


what happens when a thread cannot acquire a lock on an object? : Java thread

1030


Which is better singleton or static class?

952


Is string is a data type in java?

1009


Explain about the interpreter in java?

1010