Advertisements
Advertisements
Question
Main class by default inherits another class. Explain the given statement.
Short Answer
Solution
In Java, the Object class acts as the basic class for all other classes. This class is included in the default package of Java, java.lang. For this reason, we do not need to explicitly inherit this class. However, every class in Java inherits the Object class implicitly.
shaalaa.com
Is there an error in this question or solution?