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

Define the term string pool?

954


What is size () in java?

1035


What are the characteristics of java?

981


How do you convert an int to a double in java?

1004


Explain exception chaining in java?

1085


What is navigable map in java?

939


What is lambda programming?

939


Why do we need wrapper classes?

1011


When is update method called?

1090


What is a substring of a string?

1080


What is regex java?

1022


How many bytes is a string java?

964


Can we have more than one package statement in the source file?

1020


What is java basic concept?

971


What is the gregoriancalendar class in java programming?

971