I am iterating a Collection using foreach, I am using intelliJ IDE.
queue.forEach(s->{
System.out.println(s);
});
I am getting warning here that "Can be replaced with method reference.."
can anyone suggest how can I use method reference here?
System.out::println
This should do
queue.forEach(System.out::println);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With