title: how to print string with spaces taken by user?
body: <p>I am trying to concatenate 2 strings. I have already declared one string in the code and taking the other string as an user input. what changes do i need to make to inorder to print those concatenated strings.</p>
  
  <p><strong>Following is something I tried:</strong></p>
  
  <pre><code>String s = "Java ";
  Scanner sc = new Scanner(System.in);
  System.out.println("Enter user string:");
  String s2 = sc.nextLine(); //**user input taken:** is the best.
  
  //**for concatenation**
  
  s2=s+s2;
  System.out.println(s2);
  </code></pre>
  
  <p><strong>Output</strong>:</p>
  
  <p>expected result: </p>
  
  <blockquote>
    <p>Java is the best.</p>
  </blockquote>
  
  <p>actual result: </p>
  
  <blockquote>
    <p>Java is</p>
  </blockquote>