error message
出力から取得し続けます
Exception in thread "main java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextDouble(Unknown Source)
at test1.TC1.main(TC1.java:11)
しかし、上部にはエラーはありません
package test1;
import java.util.Scanner;
public class TC1 {
public static void main(String[] args){
double name, age, answer;
Scanner IN = new Scanner (System.in);
System.out.println("Whats yor name?");
name = IN.nextDouble();
System.out.println("How old are you?");
age = IN.nextDouble();
answer = age + name;
System.out.println(answer);
}
}