Looks to me like it is only happening in eclipse. When i compile the code though javac command through command prompt, i get this compile time error:
error: class, interface, or enum expected
Looking at the post here, looks like eclipse uses its own jdk:
Do I need to install java sdk if I have eclipse