import java.util.Scanner;
public class DoDo{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("give me value of a and b");
double a = in.nextDouble();
double b = in.nextDouble();
double dod = a + b;
System.out.println(dod);
}
}
您好。昨天我开始用java开始冒险。我做了这个简单的计算,当我给出一个值例如2.5 eclipse给我这个
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 dodo.main(dodo.java:9)
我不知道我做错了什么。