Question
Develop a java program using object cloning. Define a class Placement with variables department_name, specialization, contact_no. The class Placement contains the constructor to assign the
Develop a java program using object cloning. Define a class Placement with variables department_name, specialization, contact_no. The class Placement contains the constructor to assign the values for those variables. Define a class Applicant with variables applicant_id, applicant_name, and object placement. Assign the values to these variables using the Applicant constructor. Create an object obj1 for the class Applicant. Next, Copy (clone) this object obj1 into obj2. Update the department_name, specialization, contact_no features in cloned object obj2.
a. Feed the input from the user
b. Display the original object obj1 values.
c. Display the copied object obj2 values
. d. Check the original object values are either updated or not
. e. Find the cloning is shallow or deep cloning.
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