title: String formatting in Java Scanner class
body: <pre><code>Scanner i=new Scanner(System.in);
  
  System.out.println("Enter an integer: ");
  int in=i.nextInt();
  
  System.out.println("Enter an floating point number: ");
  double d=i.nextDouble();
  
  System.out.println("Enter a string: ");
  String str=i.next();
  
  System.out.printf("%s%n,Sum of%2d and %.2f is %.2f%n",str,in ,d,in+d);
  </code></pre>
  
  <p>My problem is with formatting the String I enter through Scanner. I was trying to enter "Result is", but printf() seems to see only the "Result" part of string, so what is the command for blank space? thx </p>