Answers for "java store return result in variable"

0

java store return result in variable

public class Main {
  static int myMethod(int x, int y) {
    return x + y;
  }

  public static void main(String[] args) {
    int z = myMethod(5, 3);
    System.out.println(z);
  }
}
// Outputs 8 (5 + 3)
Posted by: Guest on October-18-2021

Code answers related to "java store return result in variable"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language