Directly on the code
class Student {
.
Public the Teacher the Teacher getNum () {
.
}
.
}
Class the Teacher {
.
.
}
Class, please the Teacher in the Student getNum what should () method returns, the previously defined again again? For help
CodePudding user response:
For help, the WWWCodePudding user response:
Public the Teacher getNum () {.
}
Definition is returned must be an object of the Teacher or null
CodePudding user response:
The class Student {.
Public the Teacher getNum () {
.
}
.
}
The Class the Teacher {
.
.
}
Is the upper class, to paraphrase the following class, what does this method should return, return;
CodePudding user response:
Don't sink w w wCodePudding user response:
The return type of a method according to your definition of a return type to return, if you define the return type is a string, is in defining methods must return "" (or return null); If you define a return type for the fixed type, you need to return to return new the Teacher () in the corresponding type (or Null); Return type is defined according to you to return,CodePudding user response: