mercredi 10 juin 2020

Why if else statement dont work in project?

Its always say dead. What is problem?

boolean death = false;
health = 100;

if (health < 0) {
    death = true;

    System.out.println("You are dead not a big suprise.");
} else {
    death = false;
}

if (death = false) {

    System.out.println("Living man.");
} else {

    System.out.println("Completely dead.");
}

Aucun commentaire:

Enregistrer un commentaire