An exceptions lab.
Create a new class named EnterInfo
Request user enter name and age
Accept a string...
90.2K
Verified Solution
Link Copied!
Question
Programming
An exceptions lab.
Create a new class named EnterInfo
Request user enter name and age
Accept a string and an int
Use custom Exception to warn user when name is blank
Use custom Exception to warn user when age is invalid
0 > age > 120
Use general Exception to warn user when age is not an int
Loop through until user enters all valid data
Answer & Explanation
Solved by verified expert
4.1 Ratings (645 Votes)
Programimport javautilcustom exception for blank nameclass BlankException extends ExceptionBlankExceptionString strsuperstrcustom exception for invalid
See Answer
Get Answers to Unlimited Questions
Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!
Membership Benefits:
Unlimited Question Access with detailed Answers
Zin AI - 3 Million Words
10 Dall-E 3 Images
20 Plot Generations
Conversation with Dialogue Memory
No Ads, Ever!
Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!