Access the full course here: javabrains.io/courses/java_lambdabasics
This video proposes an alternative way of handling exceptions in lambdas. In the process we’ll also learn how to wrap lambda expressions in other lambda expressions!
12 Comments on "Java 8 Lambda Basics 18 – An Exception Handling Approach"
so even now if the operation is changed and if some other exception happens then it will not be handled and it will be thrown as Unhandled exception… what is the point of wrapper without generic exception being caught..
Nice video,, feel like AOP of java 🙂
now my company people will have even more complex looking hard to understand programs to look at unless they move to 1.8 beast mode… ha ha
Thanks a lot. Appreciate your effort to bring this to us:)
Lambda Version of Inception Movie 😉
This approach holds true in case of runtime exceptions. But this does not work for checked exceptions. I faced this issue while coding for work. Need to reach out to the internet to see how this could be handled.
Thank you very much, its quite hard concept to understand for me watched probably 10 times form 4:40, i think i understood eventually. thank you very much.
Great video Koushia , although i have a doubt… At the last solution for handling exception , you've created this wrapper lambda expression in which you put the try-catch block . However, in the catch you put "Arithmetic exception" which is specific for the lambda expression in this example, but that wouldn't work for other lambda expression which can throw other type of exception. Is there any full work around for this try-catch situation?
We'll have to wait for @JAVA_BRAINS to answer hehe
Had the same doubt myself. Was wondering if there is a way to pass what exception might occur from the lambda and somehow having the wrapper rely on that to handle the exception.
Best tutorial hands down Interface iF = () -> System.out.println("Thank You Sir")….Please do a JUNIT video tutorial too.
+1 to the Junit tutorial and also design patterns. You are the only one who could simplify the design patterns for the world.
In CodeChannels.com, you can learn to code by watching videos and stay up to date with latest code shows, events and tutorials aggregated from various leading developer communities.
Copyright 2016 By CodeChannels.com All rights reserved.