79251861

Date: 2024-12-04 15:54:24
Score: 1.5
Natty:
Report link

In Java, when creating a subclass object, the order of initialization is to first initialize the member variables of the parent class and call the constructor of the parent class, and then initialize the member variables of the subclass and call the constructor of the subclass.

Therefore, trying to access the member variables of the subclass within the constructor of the parent class will cause an error.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: kevin liao