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

class WaterAnimal
{
// code
}
class LandAnimal extends WaterAnimal
{
//This class has WaterAnimal properties
}
class Animal extends LandAnimal
{
//This class has both LandAnimal and WaterAnimal properties
}

Is This Answer Correct ?    10 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).

1989


Is a boolean 1 bit?

1087


What does localhost mean?

964


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1112


What is static method with example?

1185


Which collection is sorted in java?

1040


How do you control extraneous variables?

924


What is the use of http-tunneling in rmi?

1057


What is an eror in java?

1061


How do you read and print a string in java?

965


What is super in java?

1003


What is an argument in java?

945


What is the concatenation operator in java?

1163


Can a class extend more than one class?

1129


What is one third plus one third as a fraction?

942