java.util.NoSuchElementException
各位大神,求帮助。eclipse编程如下代码都编程通过了,生成jar后用exe4j编译成exe文件,打印java.util.NoSuchElementException,...
各位大神,求帮助。eclipse编程如下代码都编程通过了,生成jar后用exe4j 编译成exe文件,打印java.util.NoSuchElementException,网上看了看都说可能是因为scanner问题,加了scan.close();,不论是加在if语句的里面还是外面都报相同错误。 求大神帮下忙,感激不尽
import java.util.Scanner;public class BandConvert {
public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("请选择转化方式,输入1 or 2\n1.Fc->EARFCN 2.EARFCN->Fc"); int choice=scan.nextInt(); //double Fx; int EARFCN1; int a=0; int b=0; int Flow=0; int Noffs=0; // FOR TDD if (choice==1) { System.out.println("请输入Band:"); int Band=scan.nextInt(); System.out.println("请输入Fc的值:"); int Fc=scan.nextInt(); //Band=38代码 if(Band==38) { a=2570; Flow=a; b=37750; Noffs=b; EARFCN1=(10*(Fc-Flow))+Noffs; int L=(int)EARFCN1; System.out.println("EARFCN="+L); scan.close();
}
}
}
} 展开
import java.util.Scanner;public class BandConvert {
public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("请选择转化方式,输入1 or 2\n1.Fc->EARFCN 2.EARFCN->Fc"); int choice=scan.nextInt(); //double Fx; int EARFCN1; int a=0; int b=0; int Flow=0; int Noffs=0; // FOR TDD if (choice==1) { System.out.println("请输入Band:"); int Band=scan.nextInt(); System.out.println("请输入Fc的值:"); int Fc=scan.nextInt(); //Band=38代码 if(Band==38) { a=2570; Flow=a; b=37750; Noffs=b; EARFCN1=(10*(Fc-Flow))+Noffs; int L=(int)EARFCN1; System.out.println("EARFCN="+L); scan.close();
}
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询