擅长:python、mysql、java
<p>在Java中,return函数将对象或原语传递回调用方法(最初调用函数的代码)。调用方法可以对返回的值执行它喜欢的任何操作(包括打印)。在</p>
<pre><code>public static int myMethod() {
return 5;
}
public static void main (String[] args) {
int a = myMethod();
System.out.println(a); //prints 5
}
</code></pre>