设为首页 - 加入收藏 焦点技术网
热搜:java
当前位置:首页 >

java for loop choice

2012-04-21 20:40:00.0 java java string import class  
导读: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.printl...。。。
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");
}
}




}
}

(编辑: loveheronly)

网友评论