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 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; }

// 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!