title: How to access a string value in a while loop, outside of a while loop, all while inside a method
body: <p>The program itself is supposed to take user input and then read it off in the setup of how a Mad Lib is made. The user types in a noun, verb, adjective, etc, and then its all printed to the console in the form of a story. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class CSFacts {
  
      //first method
      public static String Noun(int on)   {           //Start first user input, start with noun
          String noun1;
          Scanner input=new Scanner(System.in);
              while (on==1)   {
                  System.out.println("Please enter a Noun.");     //prompt user to input a noun to be used in the main program
                  noun1=input.nextLine(); 
                  on=on-1;}
              while (on==0)   {
                  noun1=input.nextLine(); }
              return noun1;
          //return the noun as a string to be used in the main program
      }
      public static void main(String[] args)  {
          Noun(1);
          System.out.println("Be kind to your "+Noun(0));
      }
  </code></pre>
  
  <p>The problem that I'm facing is that noun1 wont cooperate with me in the aspect of it will not carry though from one parameter to the other. I need noun1 to carry from on=1 to on=0 so that when the method is called for a second time it reads "Be kind to your (insert noun1)". I cant seem to figure out how to carry it over. This is only a section of my lab, but if I can figure out how to do this, I can implicate it into my other methods.</p>