I am looking for a little push in the right direction. I am not quite sure what I am doing wrong on this problem. I am new to Java, so it may be a syntax error. Thanks for the help in advance.
The problem I am currently working on http://www.spoj.com/problems/EXPECT/
package pkg02730.life.the.universe.and.everything.interactive;
import java.util.*;
class LifeTheUniverseAndEverythingInteractive {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
try {
final int answerToLife = 42;
while (input.hasNext()) {
int inputValue = input.nextInt();
System.out.println(inputValue);
if (inputValue == answerToLife) {
break;
}
}
} catch (Exception e) {
}
}
}