Как мога да кажа следното:
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();
}
Моля за всякакви предложения. Благодаря.