Browse Source

create printCourseInfo method in Course class

remotes/origin/fdai7780
fdai7921 11 months ago
parent
commit
f2108da211
  1. 6
      src/main/java/org/example/Course.java

6
src/main/java/org/example/Course.java

@ -40,4 +40,10 @@ public class Course {
public void setCourseCredit(int courseCredit) { public void setCourseCredit(int courseCredit) {
this.courseCredit = courseCredit; this.courseCredit = courseCredit;
} }
public void printCourseInfo() {
System.out.println("Course Name: " + courseName);
System.out.println("Course Code: " + courseCode);
System.out.println("Course Credits: " + courseCredit);
}
} }
Loading…
Cancel
Save