Sunday, October 31, 2010

Java - Intro to Classes and Objects

If you become part of a development team in industry, you might work on applications that contain hundreds, or even thousands, of classes.




excerpt from "Java how to program, by Deitel" page 73

1 comment:

  1. Each class declaration that begins with keyword public must e stored in a file that has the same name as the class and ends with the .java file extension.

    Thus, classes GradeBook and GradeBookTest must be declared in separate files, because each class is declared public.

    **Declaring more than one public class in the same file is a compilation error!!

    ***We will use an example that consists of classes GradeBook (fig 3.1) and GradeBookTest (Fig 3.2). Class GradeBook (declared in GradeBook.java) will be used to display a message on the screen, welcoming the instructor to the grade book application. Class GradeBookTest (declared in file GradeBookTest.java) is an application class in which the main method will use an object of class GradeBook.

    ReplyDelete