📜  如何在java代码示例中调用带参数的void方法

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

代码示例1
public class methods{
  public static void main(String[] args){
    printSum(5, 15); // Print 20
  }
  public static void printSum(int a, int b){
    System.out.println(a + b);
  }
  // Our method should be outside the main methods bounds
  // Call your function inside the main method.
}