From f2108da2116da1ddaf2b2f062e780d92b055ff8b Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Tue, 6 Feb 2024 22:39:57 +0100 Subject: [PATCH] create printCourseInfo method in Course class --- src/main/java/org/example/Course.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/example/Course.java b/src/main/java/org/example/Course.java index f9f668a..2b97004 100644 --- a/src/main/java/org/example/Course.java +++ b/src/main/java/org/example/Course.java @@ -40,4 +40,10 @@ public class Course { public void setCourseCredit(int 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); + } }