close
// Fig. 3.11: GradeBookTest.java

// GradeBook constructor used to specify the course name at the

// time each GradeBook object is created.

// U3 P.110

public class GradeBookTest
{
   // main method begins program execution
   public static void main ( String args[] )
   {
      // create GradeBook object
      GradeBook gradeBook1 = new GradeBook ("XXX");
                                                 ↑呼叫建構式來建立第一個成績簿物件
      GradeBook gradeBook2 = new GradeBook ("OOO");
                                                 ↑建立第二個成績簿物件
      // display initial value of courseName for each GradeBook
      System.out.printf ("gradeBook1 course name is: %s\n",
                                   gradeBook1.getCourseNmae() ) ;
      System.out.printf ("gradeBook2 course name is: %s\n",
                                   gradeBook2.getCourseNmae() ) ;
   } // end main

} // end class GradeBookTest
---------------------------------------------------------------------------------------
gradeBook1 course name is : XXX
gradeBook2 courst name is : OOO
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 a25561970 的頭像
    a25561970

    萬花筒

    a25561970 發表在 痞客邦 留言(0) 人氣()