2.Object

Is the parent class, java in the top-level parent of all classes, all classes inherit the default object class.

This time may be another problem 

class c{
    
}
class B extends c{
    
}

Java is between class and class single inheritance, and all classes inherit Object default, then the above B is also inherited Object inherit C, that does not meet the single inheritance mechanism between the java classes and class?

A: java support multi-level inheritance, if you do not show as inheritance C then it defaults Object inheritance, as if Show Inherited parent class B then C is also the default inheritance Object B thus constitutes a multi-level inheritance Object.

Guess you like

Origin www.cnblogs.com/xuwangqi/p/11127193.html