public class Test
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner input = new Scanner("text.txt");
int x = input.nextInt();
}
}
text.txt は次のとおりです。
8
8
6
7
InputMismatch
このコードは例外をスローします。なんで?