文档介绍:×÷Õߣºjeru
email: jeru@
ÈÕÆÚ£º7/3/2001 9:54:36 AM
4) Language Fundamentals
Objective 1)
Identify correctly constructed package declarations import statements class declarations (of all forms including inner classes) interface declarations and implementations (for or other interface described in the test) method declarations (including the main method that is used to start execution of a class) variable declarations and identifiers.
Source file¡¯s elements (in order)
Package declaration
Import statements
Class definitions
2. Importing packages doesn¡¯t recursively import sub-packages.
3. Sub-packages are really different packages, happen to live within an enclosing package. Classes in sub-packages cannot access classes in enclosing package with default access.
4. Comments can appear anywhere. Can¡¯t be nested.(No matter what type ments)
5. At most one public class definition per file. This class name should match the file name. If there are more than one public class definitions, compiler will accept the class with the file¡¯s name and give an error at the line where the other class is defined.
6. It¡¯s not required having a public class definition in a file. Strange, but true. J In this case, the file¡¯s name should be different from the names of classes and interfaces (not public obviously).
7. A file can contain multiple non public classe