Question: public static void displayAge(int n) {} Java Complete and modify the following method such that it displays n to the console if n is a

public static void displayAge(int n) {}
Java
Complete and modify the following method such that it displays n to the console if n is a valid age number. If n is less than 0, or greater than a provided constant MAX_AGE (assume it is defined earlier in the code), the method should throw an Exception. The Exception's message should specify that the value passed as a parameter (i.e., n) is an invalid age
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
