jeudi 19 août 2021

Java error how (Cannot conver double to bolean)

I have been geting back in to java after a not using it for a while and tried to make a kalkulator one that has more the just + and but dont have alot of experience coding so i dont get what i did wrong it says i cant turn a double into a boolean but that's not what im doing, so here is the code i get an error on.

if (One = UserInput.nextDouble()) {
    System.out.println("Your answer is "+ Plus +"!");
    
}else if (Two = UserInput.nextDouble()) {
    System.out.println("Your answer is "+ Sub +"!");
    
}else (Three = UserInput.nextDouble()) {
    System.out.println("Your answer is "+ Multi +"!");

Aucun commentaire:

Enregistrer un commentaire