Java 8 Lambda Expressions allow us to do functional programming, but sadly they don't deal with exceptions very well.
Handling Unchecked Exceptions
Let's say we have a list of integers and we are dividing a constant number (lets say 16) with every element of this list, we need to print result of this division.
List < Integer > myList = Arrays.asList(7, 9, 16, 25, 27);
myList.forEach(i - > System.out.println(16 / i));
Handling Unchecked Exceptions
Let's say we have a list of integers and we are dividing a constant number (lets say 16) with every element of this list, we need to print result of this division.
List < Integer > myList = Arrays.asList(7, 9, 16, 25, 27);
myList.forEach(i - > System.out.println(16 / i));