小问题,可就是不明白,呵呵,菜鸟不要见怪啊。
import javax.swing.JFrame;import javax.swing.JOptionPane;
public class Test_ extends JFrame{
public static void main(String arg[]){
Test B=new Test();
B.Fn();
}
void Fn(){
String str=JOptionPane.showInputDialog("请输入你的成绩:");
int a=Integer.parseInt(str);
if (a>=60&&a<80)
JOptionPane.showMessageDialog(this,"恭喜你及格了!,继续加油!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
if (a>=80&&a<100);
JOptionPane.showMessageDialog(this,"very good!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
if (a<60&&a>40||a==40)
JOptionPane.showMessageDialog(this,"you need to study hard!","成绩情况",JOptionPane.INFORMATION_MESSAGE);
if(a<40||a==40)
JOptionPane.showMessageDialog(this,"hope you to have a good attitude","成绩情况",JOptionPane.INFORMATION_MESSAGE);
if(a>100)
JOptionPane.showMessageDialog(this,"error","成绩情况",JOptionPane.INFORMATION_MESSAGE);
}
}
当我输入12时,它为什么还会弹出very good 啊?