📜  void 与返回类型 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:46.539000             🧑  作者: Mango

代码示例1
Difference between void and return method
Void Method:
The "void" return type means that this
method doesn't have a return type.
It is mostly used for printing result 
to console
 
Return Method:
This other method on the other hand,
returns a String. This means that you can
use the returned value in your code for
further processing.I guess good examples
of such methods are "getters".