import java.util.Scanner;import javax.swing.JOptionPane;
public class Game {     /**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub
JOptionPane.showMessageDialog(null, "欢迎进入游戏");
System.out.println("请输入账号");
Scanner input=new Scanner(System.in);
String s=input.next();
System.out.println("请输入密码");
long t=input.nextLong();
if(s.equals("longaotian")&&t==123456){
String m=JOptionPane.showInputDialog("请输入数字:\n1.进入游戏 \n2.退出 ");
int num=Interger.parseInt(m);
  int a,b;
 if(num==1){
 System.out.println("请输入a的值");
 JOptionPane.showMessageDialog(null, "b="+a);
 

}
if(num==2){
 JOptionPane.showMessageDialog(null,"游戏已退出");
 
}
}
else{
System.out.println("密码错误");
}
}}
帮忙看看哪里错了

解决方案 »

  1.   

    错误一:Interger拼错,应该是Integer
    错误二:a没有读值
    PS:提醒下楼主要及时结贴import java.util.Scanner;
    import javax.swing.JOptionPane;public class Game {
    /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    JOptionPane.showMessageDialog(null, "欢迎进入游戏");
    System.out.println("请输入账号");
    Scanner input = new Scanner(System.in);
    String s = input.next();
    System.out.println("请输入密码");
    long t = input.nextLong();
    if (s.equals("longaotian") && t == 123456) {
    String m = JOptionPane.showInputDialog("请输入数字:\n1.进入游戏 \n2.退出 ");
    int num = Integer.parseInt(m);
    int a, b;
    if (num == 1) {
    System.out.println("请输入a的值");
    a = input.nextInt();
    JOptionPane.showMessageDialog(null, "b=" + a);
    }
    if (num == 2) {
    JOptionPane.showMessageDialog(null, "游戏已退出"); }
    } else {
    System.out.println("密码错误");
    }
    }
    }
      

  2.   

     Property name/type               Get method                            Set method   xcoordinate/Double     public Double getXcoordinate()  publicvoid setXcoordinate 
                                                                  (DoublenewValue)   xCoordinate/Double     public Double getxCoordinate()  publicvoid setxCoordinate 
                                                                  (Double newValue)   XCoordinate/Double     public Double getXCoordinate()  publicvoid setXCoordinate 
                                                                  (Double newValue)   Xcoordinate/Double     Not allowed                         Not allowed   student/Boolean        public Boolean getStudent()         publicvoid setStudent(Boolean 
                                                                 newValue)   student/boolean        public boolean getStudent()         public void setStudent(boolean 
                             public boolean isStudent()          newValue)