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
// 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
全站熱搜
留言列表