title: How to return 2 values from a Java method?
body: <p>I am trying to return 2 values from a Java method but I get these errors. Here is my code:</p>
  
  <pre><code>// Method code
  public static int something(){
      int number1 = 1;
      int number2 = 2;
  
      return number1, number2;
  }
  
  // Main method code
  public static void main(String[] args) {
      something();
      System.out.println(number1 + number2);
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - missing return statement
      at assignment.Main.something(Main.java:86)
      at assignment.Main.main(Main.java:53)
  </code></pre>
  
  <p>Java Result: 1</p>