By: Ash Viewed: 641 times Printer Friendly Format
Question: If all three top-level elements occur in a source file, they must appear in which order?
A. Imports, package declaration, classes
B. Classes, imports, package declarations.
C. Package declaration must come first; order for imports and class definitions is not significant.
D. Package declaration, imports, classes.
E. Imports must come first; order for package declaration and class definitions is not significant.
Answer:D is correct. This order must be strictly observed.
Most Viewed Articles (in Certification )
Latest Articles (in Certification)
Comment on this tutorial
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews