Question
Do in Java // Implement user defined exception classes class Applicant { private String name; private String jobProfile; private int age; public String getName() {
Do in Java
// Implement user defined exception classes
class Applicant {
private String name; private String jobProfile; private int age;
public String getName() { return name; } public void setName(String name) { this.name = name; } public String getJobProfile() { return jobProfile; } public void setJobProfile(String jobProfile) { this.jobProfile = jobProfile; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
class Validator{ public class ValidateName{ public String boolean{ if(name != null){ return name; }else{ exception{ System.out.println("Invalid name"); } } } } public class ValidateJobProfile{ public String ValidateJobProfile boolean{ if(jobProfile = ("associate" || "clerk" || "executive" || "Officer"){ return jobProfile; } else{ exception{ System.out.println("Invalid job post"); } } } } public class Age{ public int age boolean{ if(age(30>=age
public static void main(String[] args) { try { Applicant applicant= new Applicant(); applicant.setName("Jenny"); applicant.setJobProfile("Clerk"); applicant.setAge(25); Validator validator = new Validator(); validator.validate(applicant); System.out.println("Application submitted successfully!"); } catch (InvalidNameException|InvalidJobProfileException|InvalidAgeException e) { System.out.println(e.getMessage()); } } }
A bank wants to conduct examinations for recruitment. You need to develop an application for the applicants to submit their details by implementing the classes based on the class diagram and description given below. Applicant name: String o jobProfile: String ageint getName(): String setName(name: String): void getjob Profile(): String setJobProfileljobProfile String): void getAge: int setAgelage: int)void InvalidAgeException InvalidAgeException(message: String) InvalidJobProfileException TovalidJobProfileException message: String)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started