Question: Define a Java Class Professor Design a Java class named Professor to represent a professor. The class contains the following data fields: name (private, String),

Define a Java Class Professor

Design a Java class named Professor to represent a professor. The class contains the following data fields: name (private, String), department (private, String), annual_salary (private, double), and year_in_profession (private, int). You should define the set/get methods for each field. Also define two constructors, one fully loaded constructor and one copy constructor. Also define the toString method for it.

In a separate class named ProfessorAccess, create a main method that instantiates three professor objects using the above two constructors separately. In addition, you should show how to access and mutate the object data field by calling the access/mutator methods. Also use the toString method to print out the content of each professor object.

Please do in java and thankkss :D

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!