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 are inbuilt functions?

938


Explain wait() method of object class ?

1137


What are the types of methods in java?

1041


What is a lock or purpose of locks in java?

975


In java, how many ways you can take input from the console?

936


What is a lightweight component?

975


When is the finally clause of a try-catch-finally statement executed?

983


I want to print “hello” even before main is executed. How will you acheive that?

1049


What is serial version uid and its importance in java?

989


What is static and final keyword in java?

982


What are latest features introduced with java 8?

1012


Can we pass null as argument in java?

894


What is empty string literal in java?

995


Explain the importance of thread scheduler in java?

955


What is the significance of continue jump statement? Explain with an example.

1252