Originally posted by Tusshar Shah:
I have recently started my SCJP preparation. I am using K&B book for Java 5.
Source file declaration rules are given in 1st chapter pg no. 11.
4 and 5th point reads:
4) If the class is part of a package, the package statement must be the first line in the source code file, before any import statements that may be present.
5) If there are import statements, they must go between the package statement (if there is one) and the class declaration. If there isn't a package statement, then the import statements must be the first line in the the source code file. If there are no package or import statements, the class declaration must be the first line in the source code file.
My doubt is what is the difference between package statements and import statements. Please explain with proper example.
Thanks in advance.