Source of GradeBookTest.java


  1: // Fig. 3.11: GradeBookTest.java
  2: // GradeBook constructor used to specify the course name at the 
  3: // time each GradeBook object is created.
  4: 
  5: public class GradeBookTest
  6: {
  7:    // main method begins program execution
  8:    public static void main( String args[] )
  9:    { 
 10:       // create GradeBook object
 11:       GradeBook gradeBook1 = new GradeBook( 
 12:          "CS101 Introduction to Java Programming" ); 
 13:       GradeBook gradeBook2 = new GradeBook( 
 14:          "CS102 Data Structures in Java" );
 15: 
 16:       // display initial value of courseName for each GradeBook
 17:       System.out.printf( "gradeBook1 course name is: %s\n",
 18:          gradeBook1.getCourseName() );
 19:       System.out.printf( "gradeBook2 course name is: %s\n",
 20:          gradeBook2.getCourseName() );
 21:    } // end main
 22: 
 23: } // end class GradeBookTest
 24: 
 25: 
 26: /**************************************************************************
 27:  * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and               *
 28:  * Pearson Education, Inc. All Rights Reserved.                           *
 29:  *                                                                        *
 30:  * DISCLAIMER: The authors and publisher of this book have used their     *
 31:  * best efforts in preparing the book. These efforts include the          *
 32:  * development, research, and testing of the theories and programs        *
 33:  * to determine their effectiveness. The authors and publisher make       *
 34:  * no warranty of any kind, expressed or implied, with regard to these    *
 35:  * programs or to the documentation contained in these books. The authors *
 36:  * and publisher shall not be liable in any event for incidental or       *
 37:  * consequential damages in connection with, or arising out of, the       *
 38:  * furnishing, performance, or use of these programs.                     *
 39:  *************************************************************************/