how to end a program in an if statement java

Solutions on MaxInterview for how to end a program in an if statement java by the best coders in the world

showing results for - "how to end a program in an if statement java"
Isabel
01 Aug 2019
1 if(letters >=5 && digits >=5)
2            { 
3                System.out.println("Great job! String is acceptable");
4                System.exit(0);
5            }
6            
7            //after use, letter and digit variables reset to 0 
8            letters = 0; 
9            digits = 0; 
10        } //end a program within an if statement, which is nested with a while loop 
11		  //with the use of System.exit(0)
12		  //0 indicates successful termination 
13		  //any non-zero value indicates an unsuccessful termination 
Tao
06 Mar 2017
1continue; // skips the current itteration
2break; // breaks the itteration