菜鸟求教:为什么这个application不能退出循环?
import java.io.*;
class QuitTest
{
public static void main(String[] args) throws
IOException {
char ch;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
do
{
ch = (char)br.read();
System.out.println(ch);
}
while(ch != 'q ' || ch != 'Q ');
}
}
------解决方案--------------------while(ch != 'q ' || ch != 'Q ');
改成&&