What are the different approaches to represent an inheritance hierarchy?



What are the different approaches to represent an inheritance hierarchy?..

Answer / Kamlesh Yadav

In Java, there are three main approaches to representing inheritance hierarchies: single inheritance, multiple inheritance (using interfaces), and hierarchical inheritance. Single inheritance involves one superclass and one subclass. Multiple inheritance involves a class inheriting from multiple interfaces or multiple classes using C++-style multiclass inheritance. Hierarchical inheritance, also known as inheritance with multiple parents, involves a common superclass shared by multiple subclasses.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

how to create Calculator GUI using Gridbaglayout as like as Window Calculator??????????? (Open calculator Go-->Run-->type calc-->Enter)

1 Answers   TCS,


1) which method of the RequestDispatcher cannot be called once the output is sent to the client? a. forward b. include c. both a&b 2) which interface should an object implement to get notified of changes to the list of active sessions in a web application? a. HttpSessionListener b. HttpSessionActivationListener c. HttpSessionAttributeLIstener 3) A user can select multiple locations from a list box on an HTML form, which of the following methods can be used to retrieve all the selected location? a. getParameter() b. getParameterValues() c. getParamValues() 4) which of the following methods should be used to send character text to the client? a. ServletResponse.getWriter() b. ServletResponse.getOutputStream() c. ServletResponse.getOut() 5) which implicit object is always available in a JSP page? a. exception b. session c. out 6) which inclusion mechanism doesn't include the source of the page, rather the output of the page. a. include directive b. jsp:include action c. Bothe a& b 7) which attribute of the page controls whether a page participates in session or not? a. session-allowed b. session c. isSession

1 Answers  


What modifiers may be used with an interface declaration?

1 Answers  


In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?

1 Answers  


What is RMI Registry?

6 Answers   Siemens, United Software Solutions,


What are various types of class loaders used by jvm?

1 Answers  


What invokes a thread?s run() method?

2 Answers  


Why DOM Parser would take more Memory than SAX parser while they are parsing?

3 Answers   OnMobile,


How u validate date in DD/MM/YY format. and how u validate money in ur jsp

3 Answers   Ashok Leyland, Satyam, Tech Mahindra, Tomax,


can any one tell me how to learn good coding techniques

3 Answers  


How to pass parameters in RMI?

1 Answers  


What will happens, when a thread cannot acquire a lock on an object?

2 Answers  


Categories