Enviado em 08/02/2023 - 18:55h
@alexabolada, how to prevent this code from throwing InputMismatchException?import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Provide your age: ");
int age = keyboard.nextInt();
System.out.println("You said your age is: " + age);
}
}