Click here to watch in Youtube :
https://www.youtube.com/watch?v=wuHdFDUE2uA&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Static Method reference - Number more than 50| Method reference in Java 8 | Java method reference |
import java.util.ArrayList; import java.util.List; import java.util.function.BiPredicate; class Numbers { public static boolean isMoreThanFifty(int n1, int n2) { return (n1 + n2) > 50; } public static List<Integer> findNumbers(List<Integer> list, BiPredicate<Integer, Integer> p) { List<Integer> newList = new ArrayList<>(); for (Integer i : list) { if (p.test(i, i + 10)) { newList.add(i); } } return newList; } }LambdaDemo.java
import java.util.Arrays; import java.util.List; import java.util.function.BiPredicate; public class LambdaDemo { public static void main(String[] args) { List<Integer> list = Arrays.asList(12, 5, 45, 18, 33, 24, 40); // Using an anonymous class List<Integer> listOfNumbers = Numbers.findNumbers(list, new BiPredicate<Integer, Integer>() { public boolean test(Integer i1, Integer i2) { return Numbers.isMoreThanFifty(i1, i2); } }); System.out.println("listOfNumbers using a anonymous class = "+listOfNumbers); // Using a lambda expression listOfNumbers =Numbers.findNumbers(list, (i1, i2) -> Numbers.isMoreThanFifty(i1, i2)); System.out.println("listOfNumbers using a lambda expression = "+listOfNumbers); // Using a method reference listOfNumbers = Numbers.findNumbers(list, Numbers::isMoreThanFifty); System.out.println("listOfNumbers using a method reference = "+listOfNumbers); } }Output
listOfNumbers using a anonymous class = [45, 33, 24, 40] listOfNumbers using a lambda expression = [45, 33, 24, 40] listOfNumbers using a method reference = [45, 33, 24, 40]Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/LambdaDemo_static_method_ref_more50_app.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/LambdaDemo_static_method_ref_more50_app
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/525432e9afa25ee5052810cb2318f64453ffeffa/BasicJava/LambdaDemo_static_method_ref_more50_app/?at=master
See also:
It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
ReplyDeleteJava Training in Chennai
Great Article android based projects
ReplyDeleteJava Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
rastgele görüntülü konuşma - kredi hesaplama - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram beğeni satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - polen filtresi - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - webturkey.net - karfiltre.com - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeletewww.escortsmate.com
ReplyDeleteescortsmate.com
https://www.escortsmate.com
I wish to show thanks to you just for bailing me out of this particular
ReplyDeletetrouble.As a result of checking through the net and meeting
techniques that were not productive, I thought my life was done.
oracle certification in Chennai
asp net training in Chennai
C # Training in Chennai
tiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
binance referans kimliği
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo
Breeze Cool
ReplyDeleteAC Repair
Best Split AC
AC Duct
ReplyDeleteAC Services
İnstagram takipçi satın al! İnstagram takipçi sitesi ile takipçi satın al sende sosyal medyada fenomen olmaya bir adım at. Sende hemen instagram takipçi satın almak istiyorsan tıkla:
ReplyDelete1- takipçi satın al
2- takipçi satın al
3- takipçi satın al
شركة مكافحة حشرات
ReplyDeleteمكافحة حشرات