title: Reading multiple nextint
body: <p>The scanner stops reading the integers after the first one from the scanner class. How do I make it read them all, even if there are spaces?</p>
  
  <pre><code>System.out.println("please enter numbers to decrypt"); 
  num = sc.nextInt();  // number to decrypt
  result = sourcetext.charAt(num); //retrives each character that num points it to from sourcetext
  int i=0;
  for(i = 0; i &lt; num; i++) {
      temp= sourcetext.charAt(sourcetext.indexOf(i));
  }
  System.out.println(sourcetext.charAt(sourcetext.indexOf(i)));
  </code></pre>