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

Answers

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.
Java
public class world {
..........
}
public class continenet extends world {
............
}
public class country extends continent {
......................
} 1234567891011121314151617
public class world { .......... } public class continenet extends world { ............ } public class country extends continent { ...................... }

    Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Explore the analysis of transposable elements in biological research.
  • Q What is the important feature of inheritance?
  • Q Do you know what is the use of desktop virtualization?
  • Q The number of parliamentary seats (Rajya Sabha) of Karnataka is
  • Q Explain inner and outer joins with examples.
  • Q Describe your problem solving skills.
  • Q What is shadow balance?
  • Q How to implement globalization and localization in the use interface in .net ?
  • Q A&B fill 3 litres and 5 litres of oil in the car. C pays Rs. 8/- to A7B. How much will A get?
  • Q what is the floral formula of Tamaricaceae ?
  • Q What are the various reporting tools in the market?