- class person
- {
- String name;
- person(String name)
- {
- this.name = name;
- }
- public String getName()
- {
- return name;
- }
- }
- class student extends persin
- {
- student(String name )
- {
- super(name);
- }
- }
复制代码
求解答下,如果new student("张三")。程序的执行顺序是什么,先是把“张三”传给person类中的name 变量?还是先调用父类中的构造函数? |
|