posted 14 years ago
Can someone please explain why multiple delimiters causing compilation error here.
compilation error:
c:\SCJPDemo>javac ATest.java
ATest.java:3: 'class' or 'interface' expected
import java.io.*;;;;
^
---------------------------------------------------------
compiles without any error:
--------------------------------
compiles without any error:
--------------------------------
compilation error:
c:\SCJPDemo>javac ATest.java
ATest.java:4: 'class' or 'interface' expected
import java.util.*;;;;
^
I understand the below scenarios:
1) If there are multiple delimiters next to package statement and also any import statement exists -> compilation error
2) If there are multiple delimiters next to package statement and there is NO import statement -> NO compilation error
3) If there are multiple delimiters next to import statements and there exists another import statement next to it -> compilation error
4) If there are multiple delimiters next to import statements and there is NO import statement next to it -> NO compilation error
Any inputs??
Thanks,
Sridhar.