vendredi 5 octobre 2018

Using more than one condition at the same time in if else statements

So I have a question involving if else statements using JAVA. I'm stuck on how to put two conditions withing the parenthesis or if that is even possible?

So far this is my code:

public class rollerCoaster {

int age = 11;
int weight = 81;

if ( age <= 10 && weight < 10 ) {
        System.out.println("This person needs to ride the black roller coaster.");
}
else if ( age <= 10 && weight >= 80 && <= 200  ) {

}
else {

}

//The new part is this:

else if ( condition_two ) {

}

};

Aucun commentaire:

Enregistrer un commentaire