Java Reference
In-Depth Information
public int getCredits()
//Method to return the credit hours
//Postcondition: The value of courseCredits is returned.
public void copyCourseInfo(Course otherCourse)
//Method to copy a course's information.
//otherCourse is copied into this course
//Postcondition: courseName = otherCourse.courseName;
//
courseNo = otherCourse.courseNo;
//
courseCredits = otherCourse.courseCredits;
public Course()
//Default Constructor
//The object is initialized to the default values.
//Postcondition: courseName = ""; courseNo = "";
// courseCredits = 0;
public Course(String cName, String cNo, int credits)
//Constructor
//The object is initialized according to the parameters.
//Postcondition: courseName = cName; courseNo = cNo;
//
courseCredits = credits;
Figure 10-18 shows the UML class diagram of the class Course .
1
0
FIGURE 10-18 UML class diagram of the class Course
Next, we discuss the definition of the methods to implement the operations of the
class Course .
Search WWH ::




Custom Search