Write a Java program to accept an age from the user, if age is less than 18 then throw ‘‘Invalid age’’ user defined exception.
Answers
Answered by
3
Java program to accept an age from the user, if age is less than 18 then throw ‘‘Invalid age’’ user defined exception
AfreenMohammedi:
go search on Google
Answered by
3
Answer:
In java we can create our own exception class and throw that exception using throw ... These exceptions are known as user-defined or custom exceptions. ... Example of User defined exception in Java.
Similar questions