Business Studies, asked by tanmayjana1408, 1 year ago

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 Anonymous
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
AfreenMohammedi: ruhi455
AfreenMohammedi: and see
AfreenMohammedi: saw?
Anonymous: ok
AfreenMohammedi: hmmm
Anonymous: my name...n my pics
Anonymous: all r coming
AfreenMohammedi: yep...
Anonymous: hmm
Answered by AfreenMohammedi
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