title: Sentence builder java
body: <p>I am attempting to make this code take each variable, pass it down to the builder method and have it create a full sentence based on what was input by the user. The builder method passes it back to the main method and prints out the complete sentence consisting of "subject + verb + adjective + object + adverb".  </p>
  
  <p>Do I need to store each user input into an ArrayList? If so, how do I prompt the user for each new sentence piece? I've tried using for loops, however it just asks me for the first line 5 times, assuming I make the Array[5]. </p>
  
  <pre><code>package assignment.pkg4.pkg3.string.input;
  import java.util.Scanner;
  
  public class Assignment43StringInput {
      private static Scanner scanner = new Scanner( System.in );
      public static void main(String[] args) {
  
          System.out.print("Enter a subject: ");
          String subject = scanner.nextLine();
  
          System.out.print("Enter a verb: ");
          String verb = scanner.nextLine();
  
          System.out.print("Enter an adjective: ");
          String adjective = scanner.nextLine();
  
          System.out.print("Enter an object: ");
          String object = scanner.nextLine();
  
          System.out.print("Enter an adverb: ");
          String adverb = scanner.nextLine();
  
  
          System.out.print(builder(text));
  
      }
  
      public static String builder(String text) {
          String sentence = subject + verb + adjective + object + adverb;
          return sentence;
      }            
  }
  </code></pre>