Created
October 22, 2020 10:25
-
-
Save viveknaskar/2240c8591cca291d161f3949d07614d8 to your computer and use it in GitHub Desktop.
Lambda Expressions Example with No Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.viveknaskar; | |
public class LambdaExample { | |
public static void main(String[] args) { | |
WishingInterface wishing = () -> { | |
return "Hello World!"; | |
}; | |
System.out.println(wishing.wish()); | |
} | |
interface WishingInterface { | |
public String wish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment