title: Reading multiple strings in java
body: <p>I have to read strings from the user based on a number <code>n</code> and store <code>n</code> strings in <code>n</code> different variables. I'm stuck with how to put them into different strings. Please help me out.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public static void main(String[] args) {
        int b;
        String s="";
  
        Scanner in = new Scanner(System.in);
  
        System.out.println("Enter verifying number: ");
        b = in.nextInt();
  
        for (int i=0; i&lt;=b; i++) {
  
            System.out.println("Enter a string: ");
            s = in.nextLine();
        }
  </code></pre>
  
  <p>So if <code>b = 5,</code> i have to input 5 strings from the user and store them in 5 different string variables. I'm able to take it from the user but not able to assign them into different variables. Can u please help me out?
  Thanks.</p>