Skip to content

Instantly share code, notes, and snippets.

@kasundharmadasa
Created November 28, 2018 11:43
Show Gist options
  • Save kasundharmadasa/ea5c836e6e455c92bea6b15bb68ff4e6 to your computer and use it in GitHub Desktop.
Save kasundharmadasa/ea5c836e6e455c92bea6b15bb68ff4e6 to your computer and use it in GitHub Desktop.
import java.util.function.Consumer;
public class Main {
public static void main(String[] args) {
Consumer<String> lambda = s1 -> System.out.println("Hi " + s1);
lambda.accept("Alice"); //Output : "Hi Alice"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment