If three top-level compilation units are present, then they must appear in the following order : Java Source « Java Source And Data Type « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Java Source And Data Type » Java Source 
1.1.4.If three top-level compilation units are present, then they must appear in the following order
1.Package declaration
2.Import statements
3.Class, interface, and enum definitions

If no a package statement, import statement(smust be the first line(sin the source code file. 
If no package or import statements, the class declaration must be the first in the source code file.
Import and package statements apply to all classes within a source code file. 
There's no way to declare multiple classes in a file and have them in different packages, or use different imports.


package com;
import java.util.List;
public class MainClass{
   private int iValue;
}
1.1.Java Source
1.1.1.Source Files
1.1.2.Three top-level compilation units may appear in a file.
1.1.3.Three top-level compilation units are not all required.
1.1.4.If three top-level compilation units are present, then they must appear in the following order
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.