title: Trouble capturing a return value from one method to another
body: <p>I am currently on creating a small application in Java. However, I am now stuck. I'm having trouble capturing a return value from one method to another.</p>
  
  <p>Here is an example of when I return value and where I want to capture it:</p>
  
  <pre><code>public int[] highest(int y[]){
      int largest = 500;
      int largeArr[] = new int[y.length];
      for(int count = 0; count &lt; y.length; count++)
      {        
          if(y[count] &gt;= largest){
              largeArr[count] = y[count];
              System.out.print(largeArr[count] + " ");  
          }
      }
      return largeArr;
  }
  
  public void highText()
  {
      RandomNumbers high = new RandomNumbers();
      System.out.println("\nDessa tal är " + high.highest() + " intervallet 500 - 999: ");
  }
  </code></pre>
  
  <p>I am well aware that I should avail myself of parameters and arguments. But this becomes a problem for me when I want to print text at a later time</p>
  
  <p>Entire code:</p>
  
  <pre><code>RandomNumbers rnd = new RandomNumbers();
  
          rnd.highText();
          rnd.highest(nummer);
  
  
  
  import java.util.Scanner;
  
  public class RandomNumbers {
          public void rnd(int y[]){
              for(int count = 0; count &lt; y.length; count++)
              {
                  y[count] = (int) ( Math.random()*1000);
                  System.out.print(y[count] + " ");
              }
          }
  
          public int[] lowest(int y[]){
              int largest = 499;
              int smallArr[] = new int[y.length];
              for(int count = 0; count &lt; y.length; count++)
              {    
                  if(y[count] &lt;= largest){
                      smallArr[count] = y[count];
                      System.out.print(smallArr[count] + " ");
                  }
              }
              return smallArr;
          }
  
          public int[] highest(int y[]){
              int largest = 500;
              int largeArr[] = new int[y.length];
              for(int count = 0; count &lt; y.length; count++)
              {        
                  if(y[count] &gt;= largest){
                      largeArr[count] = y[count];
                      System.out.print(largeArr[count] + " ");  
                  }
              }
              return largeArr;
          }
  
          public void highText()
          {
              RandomNumbers high = new RandomNumbers();
              System.out.println("\nDessa tal är " + high.highest() + " intervallet 500 - 999: ");
          }
          public void lowText()
          {
              System.out.println("\nDessa " + smallArr + " tal är i intervallet 0 - 499: ");
          }
  
      public static void main(String[] args) {
          Scanner user_input = new Scanner(System.in);
  
          System.out.print("Hur många slumptal i intervallet 0-999 önskas? ");
          int x = user_input.nextInt();
          int nummer[] = new int[x];
  
          RandomNumbers rnd = new RandomNumbers();
  
          System.out.println("\nHär är de slumpade talen: ");
          rnd.rnd(nummer);
  
          rnd.lowText();
          rnd.lowest(nummer);
  
          rnd.highText();
          rnd.highest(nummer);
       }
  
  }
  </code></pre>
  
  <p>When I print the text, I use the method rnd.highText ();. If I previously am using largeArr in parameters, so the program requests argument - when I really just want to print the method: (</p>
  
  <p>Please help =)</p>