import java.io.*;
public class TestInput {
public static void main(String[] args) {
String input=null;
boolean flag=false;
try {
while (!flag) {
System.out.print ("Input string:");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
input=br.readLine();
if(input.equals("exit")){
flag=true;
}
else {
System.out.println ("Your input string is:"+input);
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
public class TestInput {
public static void main(String[] args) {
String input=null;
boolean flag=false;
try {
while (!flag) {
System.out.print ("Input string:");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
input=br.readLine();
if(input.equals("exit")){
flag=true;
}
else {
System.out.println ("Your input string is:"+input);
}
}
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货