Question: 1. Write a fully-documented class named Course which contains the course name (String), department (String), code (int), section (byte), and instructor (String). You should provide

 1. Write a fully-documented class named Course which contains the course

1. Write a fully-documented class named Course which contains the course name (String), department (String), code (int), section (byte), and instructor (String). You should provide accessor and mutator methods for each variable. The mutator methods for code and section should throw an appropriate exception for invalid values (e.g. a negative valu). Also, include a constructor for the class, as well as the clone ) and equals ) methods. The full list of required methods is: public Course - constructor (you may include a constructor with parameters) .getter/setter methods for each variable public object clone () the return value is a copy of this Course. Subsequent changes to the copy will not affect the original and vice versa. Note that the return value must be typecasted to a Course before it can be used. public boolean equals (Object obj) a return value of true indicates that obj refers to a Course object with the same attributes as this Course. Otherwise, the return value is false

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!