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...

Can a class be a super class and a sub-class at the same time? Give example.

Answer Posted / hrindows@gmail.com

If there is a hierarchy of inheritance used, a class can be a super class for another class and a sub-class for another one at the same time.
In the example below, continent class is sub-class of world class and it’s super class of country class.
public class world {
..........
}
public class continenet extends world {
............
}
public class country extends continent {
......................
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by thread safe?

967


What are the benefits of operations in java?

1041


Can a constructor be private and how are this() and super() method used with constructor?

995


What is methods in java?

1002


Can a static class have a constructor?

999


Can memory leak happen java?

999


What is connection class in java?

957


How do I run java on windows?

1166


Difference between serialization and deserialization in java?

1134


What are the steps in the jdbc connection?

1014


What is the main use of java?

1159


How do you calculate roots in java?

1081


What is final modifier?

1047


What are the loops in java?

983


What is member in java?

1011