0% found this document useful (0 votes)
19 views1 page

Exceptions Task

The document contains instructions for 3 Java exercises: 1) Validate an employee's first and last name and throw a custom exception if blank, 2) Validate a person's age is above 15 and throw a custom exception if not, 3) Create a custom EmployeeException if an employee's salary is below 3000 and throw it.

Uploaded by

venkata akhil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Exceptions Task

The document contains instructions for 3 Java exercises: 1) Validate an employee's first and last name and throw a custom exception if blank, 2) Validate a person's age is above 15 and throw a custom exception if not, 3) Create a custom EmployeeException if an employee's salary is below 3000 and throw it.

Uploaded by

venkata akhil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 4: Write a Java Program to validate the full name of an

employee. Create and throw a user defined exception if firstName and


lastName is blank.

Exercise 5: Validate the age of a person and display proper message by


using user defined exception. Age of a person should be above 15.

Exercise 6: Create an Exception class named as


“EmployeeException”(User defined Exception) in a package named as
“com.cg.eis.exception” and throw an exception if salary of an employee
is below than 3000. Use Exception Handling mechanism to handle
exception properly.

You might also like