This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
How to exit the If loop???
Posted by Subbarao on February 02, 2002 at 4:34 PM
Hi All, Can anyone tell me how to exit the if loop. Please go through the following example. 'a' is a string variable. This equals always other than abc, bcd & ccd and goes to the elase part and displays the message. After you click ok on the message window, it goes to next screen. I want to exit the loop without going to next screen. Can anyone tell me how to exit the if loop??? Something like similar to break in switch statement. if (a.equals("abc")) { isAbcOk = false; } else if (a.equals("bcd")) { isAbcOk = true; } else if (a.equals("ccd")) { isAbcOk = true; } else { displayErrorDialog(lengthButton, "You typed abc", logon); } Thanks, Subba Rao
Replies:
|