我怎么能说以下内容:虽然不是条件
while(input is not an int){
do this
}
我想这个代码,但我知道这是错误的:
int identificationnumber;
Scanner sc3 = new Scanner(System.in);
identificationnumber = sc3.nextInt();
while(identificationnumber != int){ // this line is wrong
Scanner sc4 = new Scanner(System.in);
identificationnumber = sc4.nextInt();
}
任何建议please.Thanks。
因此你得到一个int并且想检查它是否不是一个?那么还有什么呢? – guitarflow 2012-02-09 00:49:10
http://stackoverflow.com/questions/2674554/how-know-a-variable-type-in-java – AJP 2012-02-09 00:50:47