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.



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

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

More Core Java Interview Questions

Can you instantiate the math class in Java?

0 Answers   IBS,


What is a lightweight component?

0 Answers  


class A { public void disp(int a,int b) { System.out.println("hai"); } } class B { public void disp(int a,int b,int c) { System.out.println("hai"); } } above program is overloading or overriding?

9 Answers   Infosys, Wipro,


Define nashorn in java8.

0 Answers  


Can java cast null?

0 Answers  


Differences between GridLayout and GridBagLayout?

1 Answers  


Which class is the superclass for all the classes?

0 Answers  


Can anonymous class have constructor?

0 Answers  


How do you declare a destructor in java?

0 Answers  


difference between vectorlist and hash

1 Answers   TCS,


I have 2 objects inside one object(vector). how can i serialize one of them. I dont want to serialize the second one

3 Answers   ABC, L&T,


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

0 Answers  


Categories