Skip to Main Content

New to Java

Eclipse does not recognize "Default Method keyword" and "Lamda expression"

Nhuy VanJun 2 2014 — edited Jun 10 2014

Hi guys, I just started learning Java, so I don't know much about it. I have this very annoying issue with Eclipse (I have the latest version installed). For some reason, every time I use the "default" keyword in an interface, it gives me an error similar to "Syntax error on token default",  I deleted the "default" keyword, the error is gone. The same thing happens with "Lamda expression as well", say I have this object like this Actions myActions = () -> {System.out.print("Blah blah blah");};   , Eclipse also displays the error message similar to "Method body expected after (), delete '->' ". I checked the Java version I have, it is the latest one also, I don't know what it's wrong here, any suggestions are greatly appreciated. Thank you very much for your time and help.

This post has been answered by unknown-7404 on Jun 9 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2014
Added on Jun 2 2014
22 comments
9,112 views