Khi nhâp điểm 4.3 thì chương trình ra lỗi:Exception in thread “main” java.lang.NumberFormatException: For input string: “4.3”
Mọi người chỉ lỗi và cách giải quyết giúp em vs!!
try{
while(check == false){
System.out.println("Nhap vao diem: ");
float ndiem =Integer.parseInt(input.nextLine());
if(ndiem<0 || ndiem>10){
throw new NgoaiLe2();
}
check = true;
}
}catch(NgoaiLe2 b){
System.out.println(b);
}