`
java-mans
  • 浏览: 11515810 次
文章分类
社区版块
存档分类
最新评论

java for loop choice

 
阅读更多
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class RunTest {
public static void main(String[] args) throws IOException {
while(true){
System.out.println("There are three choice :1 2 3");
System.out.println("Please Enter your choice:");
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
String name = br.readLine();
if( "1".equals(name)){
System.out.println("Your choice is 1");

}
if ("2".equals(name))
{
System.out.println("Your choice is 2");
}
if ("3".equals(name))
{
System.out.println("Your choice is 3");
}
}




}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics