Question: PLEASE POST OUTPUT ALSO Task 2: Define an exception class InvalidAge. - Write a Java program: O To apply for a license by accepting the

PLEASE POST OUTPUT ALSO
Task 2: Define an exception class InvalidAge. - Write a Java program: O To apply for a license by accepting the user inputs such as first name, last name , DOB , City , Location, etc.. O Generates a random registration number upon successful registration using Math.Random class. O If the age of the applicant is less than 18 it has to throw the InvalidAge defined above. Demonstrate the Exception Handling using above scenario. Include try, catch, throw and finally keywords in your program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
