Method displayMessage

Method displayMessage (lines 22–28) does not return any data when it completes its task, so its return type is void. The method does not receive parameters, so the parameter list is empty. Lines 26–27 output a welcome message that includes the value of instance variable courseName, which is returned by the call to method getCourseName in line 27. Notice that one method of a class (displayMessage in this case) can call another method of the same class by using just the method name (getCourseName in this case).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset