Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to end a program in an if statement java

 if(letters >=5 && digits >=5)
            { 
                System.out.println("Great job! String is acceptable");
                System.exit(0);
            }
            
            //after use, letter and digit variables reset to 0 
            letters = 0; 
            digits = 0; 
        } //end a program within an if statement, which is nested with a while loop 
		  //with the use of System.exit(0)
		  //0 indicates successful termination 
		  //any non-zero value indicates an unsuccessful termination 
Comment

exit an if statement java

continue; // skips the current itteration
break; // breaks the itteration
Comment

PREVIOUS NEXT
Code Example
Java :: java delete directory with files 
Java :: qr code generator in java 
Java :: java example 
Java :: how to create a stack data structure in java? 
Java :: in place transpose in a matrix in java 
Java :: string remove last character 
Java :: get type java 
Java :: wait random time java 
Java :: how to declare an array in java 
Java :: get distance from latitude and longitude code android 
Java :: swing button 
Java :: static int java 
Java :: why are there no destructors in java? 
Java :: map interation in java 
Java :: how to do infinte loop in java 
Java :: How to iterate hashmap entries in java 
Java :: random numbers java 
Java :: android play sound file from assets 
Java :: add view to relativelayout programmatically 
Java :: keytool error: java.io.FileNotFoundException: my-release-key.keystore (Access is denied) java.io.FileNotFoundException: my-release-key.keystore (Access is denied) 
Java :: java install in fedora 
Java :: string.join java 8 
Java :: square root of a number in java without sqrt 
Java :: load file as string java 
Java :: str.substring last 2 java 
Java :: spring boot save file to static folder 
Java :: for loop javasctip 
Java :: convert javascritp getTime() to datetime 
Java :: java enums 
Java :: array input java 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =