Java:InputMismatchException

时间:2018-11-20 12:08:02

标签: java main inputmismatchexception

我有错误:

export class BasketmenuComponent implements OnInit, OnDestroy {
  product : Product;
  subscription : Subscription;

  constructor(private basketdataService: BasketdataService) {
    this.subscription = this.basketdataService.onGetBasket().subscribe(product=> { this.product = product; });
  }
  ngOnInit() {
  }
  ngOnDestroy() {
    // unsubscribe to ensure no memory leaks
    this.subscription.unsubscribe();
  }

我有一个employee和employeetest类...当我运行程序时,在初始化第二个对象时,在姓氏后面有错误。

我无法输入employee2的双“薪水”。

如何解决此问题?

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 EmployeeTest.main(EmployeeTest.java:28)  

0 个答案:

没有答案