package org.com.demo1.cn;
import java.io.*;
public class Test {
public static void main(String[] args) {
char yesno;
String str;
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
try {
str=br.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
yesno=str.getBytes();//错误的语句
switch(yesno){
case 'n':
case 'N':
System.out.println("You input is No!");
break;
case 'y':
case 'Y':
System.out.println("You input is Yes!");
break;
default:
System.out.println("Wrong input!");
}
}
}
怎么可以接受键入字母呢,也就是判断敲击的是哪个键?哪位大哥能把我告诉我谢谢!!