Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java yes or no loop

import java.util.Scanner;

public class Temperature
{
 public static void main(String[] args){

    Scanner input = new Scanner (System.in);
    do{
    
    
     System.out.println("Would you like to continue?(yes/no)");
        prompt = input.next();
    }while(prompt.equalsIgnoreCase("yes")); 
  }
 }
Comment

PREVIOUS NEXT
Code Example
Java :: java regex ip 
Java :: duplicate local variable in java 
Java :: round off java 2 decimal places 
Java :: Java Copying Arrays Using copyOfRange() method 
Java :: sort array java 
Java :: array to array list 
Java :: android java convert double to 2 decimal places 
Java :: How to determine if a given binary tree is a binary search tree, in Java? 
Java :: spring security enable global cors 
Java :: java printf double 2 decimal places 
Java :: print to console in java 
Java :: float random class java 
Java :: get first character of string java 
Java :: how to loop through a 2d array java 
Java :: android hide system bar programmatically 
Java :: android retrofit get @query 
Java :: java 8 filter first 
Java :: prime number between given range in java 
Java :: java print array as string 
Java :: java create image 
Java :: remove extra spaces java 
Java :: java reverse linked list 
Java :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
Java :: what it means when create final variable in java 
Java :: java convert LocalDateTime to long 
Java :: jframe actionlistener 
Java :: check last character of a string java 
Java :: runnable interface in java 
Java :: how to send get request in java 
Java :: volatile in java 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =