Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed).
thanks in advance.
Here is an example that repeatedly prompts the user to enter data until they type 'done' in any case.
import java.io.*; class Input { public static void main(String[] args) throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter: "); String str=br.readLine(); while(!str.equalsIgnoreCase("done")){ System.out.print("Enter: "); str=br.readLine(); } } }
Ads