Srinivas Palam wrote:Thanks All. Yes, it was old version issue. I have downloaded jdk1.5 and the programs compiled successfully.
why still java 1.5 ? latest version of java is java 7. also java 6 will be discontinued support from february next year. if you are preparing for ocpjp 6 then you should/must use java 6 or 7. there are some additions for e.g using enums in switch statement that were added in java 6. so i recommend to download latest version.