方法的注意事项(Method considerations)

方法不能嵌套定义

void无返回值,可以省略return 或单独写return,后面不加数据。

定义方法时应明确

  返回值类型

  参数个数、类型

调用方法时应明确

  void直接调用

  非void用变量接收

————————

Methods cannot be nested

Void has no return value. You can omit return or write return separately without data.

The method shall be clearly defined

Return value type

Number and type of parameters

The method should be called explicitly

Void direct call

Non void variable reception