mercredi 21 octobre 2020

Checking IF condition then bypass it to ELSE

I have a block of IF ELSE condition statement. Let's say that this is my code

How do I get to the IF ELSE of isTrue of code without changing the A or B? I tried return true but It wouldn't return because it's in a method. Is there any keyword to do so?

public void test() {
 if (text1.equals("") {
   //Output error message
 } else if (text2.equals("") { 
   //Ouput error message
 .
 .
 .
 } else if (A!= null && (A > B))  {
   //GO TO ELSE condition without changing the A or B
 } else { if (isTrue){} }
}

Thanks.

Aucun commentaire:

Enregistrer un commentaire