📜  返回方法 - Java 代码示例

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

代码示例3
public class App {
    public static void main(String[] args) 
    {
        int x = 3;
        int answer = addFive(x);
        System.out.println("answer is = " + answer);
    }

    private static int addFive(int px) 
    {
        px += 5;
        return px;
    }
}