title: Get String From Another Method?
body: <p>I have two methods, the first one creates a string, then I want to use that string in the second method. </p>
  
  <p>When I researched this, I came across the option of creating the string outside of the methods, however, this will not work in my case as the first method changes the string in a couple of ways and I need the final product in the second method.</p>
  
  <p>Code: </p>
  
  <pre><code>import java.util.Random;
  import java.util.Scanner;
  
  
  public class yaya {
      public static void main(String[] args) {
          System.out.println("Enter a word:");
          Scanner sc = new Scanner(System.in);
          String input = sc.nextLine();
          Random ran = new Random();
          int ranNum = ran.nextInt(10);
          input = input + ranNum;
      }
  
      public void change(String[] args) {
          //more string things here
      }
  }
  </code></pre>