My Java Quiz

The ultimate place to learn Java!

Question #55: What does code below print

String numbers = "1 2 3 4 5 6";
Scanner input = new Scanner(numbers);

int sum = 0;
while(input.hasNext())
{
  System.out.print((sum+=Integer.parseInt(input.next()))+",");
}