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 the scope or life time of instance variables?

1119


How java is similar to c?

1054


What is callable java?

983


How do you do a line break in java?

1026


Write a program to check for a prime number in java?

1042


What is stringjoiner ?

965


How do you do absolute value in java?

985


How do you define a parameter?

1038


What is the flag in java?

1067


What is consumer in java?

979


What kind of variables a class can consist of?

1107


How we can generate random numbers in java?

1134


What are the restriction imposed on a static method or a static block of code?

1060


What is an example of a conditional statement?

1056


Is there any difference between synchronized methods and synchronized statements?

1100