Integerquestion lab exception handling detect input string
Ex: If the input is:
Lee 18
then the output is:
Lee 19
import java.util.Scanner;
import java.util.InputMismatchException;
public class NameAgeChecker {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Solved Step By Step with Explanation : Exception handling to detect input String vs. Integer
public class NameAgeChecker {
public static void main(String[] args) {
while (!inputName.equals("-1")) {
try {
System.out.println(inputName + " 0");
}