Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. package functional.interfaces;
  2.  
  3. @FunctionalInterface
  4. interface LambdaFinal{
  5. void printMessage(String msg);
  6. }
  7.  
  8. public class LambdaTest06 {
  9.  
  10. public static void main(String[] args) {
  11.  
  12. String value1 = "hello";
  13. String value2 = "java";
  14. final String value3 = "world";
  15. LambdaFinal lambda01 = message -> System.out.println(message + ". " + value1 + " "+ value2 + " " + value3);
  16. // value2 = "java8";
  17. // burada value2 ' ye tekrar deger set etmek istersek,
  18. // compile error verir, value2 legal degildir.
  19. // effectively final degildir.
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement