User-defined exception

  • Eclipse: Oxygen
  • Java: 1.8

User defined exception is manually defined by the users as suggested by the name. For example while developing a simple HTML form we want to throw an exception when the password length is less than 8 than such exceptions are used.

App class

Output

org.studyeasy.UserDefinedException
at org.studyeasy.App.someMethod(App.java:33)
at org.studyeasy.App.main(App.java:12)

Contributed by Poonam Tomar


VIEW COURSES

Buy me a coffee!

 

PayTM QR (INDIA)

  • Get video tutorials
  • Project files set
  • Get┬áCertified

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu