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

class LandAnimal
{
//some code here

}
class WaterAnimal extends LandAnimal
{
//soma code here
}
class Animal extends landAnimal
{
// here we can access properties both class
}

Is This Answer Correct ?    2 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is exception handling in java?

983


How do you represent a space in regex java?

959


Does java arraylist maintain insertion order?

940


Explain java heap space and garbage collection?

1008


Can we override constructor in java?

1044


Is string an object?

1064


Differentiate between array list and vector in java.

1068


How a variable is stored in memory?

924


What are the differences between c++ and java?

1078


What do you mean by synchronized non access modifier?

948


What language is pass by reference?

971


What is widening and narrowing in java? Discuss with an example.

988


What is difference between call by value and call by reference?

937


What is this keyword in java?

986


What is an example of procedure?

959