Exception handling Interview Questions and Answers in Java | Code Decode | Live Demo | Part 2

  Рет қаралды 38,484

Code Decode

Code Decode

Күн бұрын

Experienced and Freshers both candidate can refer this video of Code Decode Exception handling Interview Questions and Answers
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/udemycourse
Course Description Video :
yt.openinapp.co/dmjvd
Exceptional Handling Part -1 : • Exception Handling Int...
This video covers exception handling frequently asked interviews and answers with Live code demos . It covers Chained exceptions, exception propagation such concepts.
Lets understand this with an example. Where the normal flow of your java application goes like this. You send a http request for a resource to controller.
Controller handles it and send to Service where business logic is written which in turn gives inputs to DAO layer If database interaction is needed. Then finally data is Added or fetched to or from data base back to Same flow from DB to DAO to Service/ business layer to controller which sends response to UI and u get the data form the DB or update the data in DB.
Now Consider a situation where Database exception occurs and u need to tell this to user. You can see multiple layer in between. How to preserve the original exception when it propagates across multiple logical layers in a program?
Answer is through Exception Chaining.
Here Database throws SQLException. Which is caught by DAO class.
DAO class throws DAOException which is caught by Catch block in Service class.
Service class throws the catched DAO exception as ServiceException which in turn is caught by controller .
Controller will now handle it appropriately and send the user friendly message to UI to be shown.
The printed exception stack trace reveals an exception propagates from the SQL / DB layer up to the Controller layer.
This is called exception propagation which helps in debugging process.
Chained Exceptions allows to relate one exception with another exception, i.e one exception describes cause of another exception.
Methods Of Throwable class Which support chained exceptions in java :
getCause() method :- This method returns actual cause of an exception
initCause(Throwable cause) method :- This method sets the cause for the calling exception.
The initCause() method of Throwable class is used to initialize the cause of the this Throwable with the specified cause passed as a parameter to initCause(). Actually, the cause is the throwable that caused this throwable Object to get thrown when an exception occurs. This method can be called only once. Generally, This method is called from within the constructor, or immediately after creating the throwable.
Chained exception helps during exception handling. you get the real cause of exception
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
SQL Playlist : • SQL Interview Question...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : kzfaq.info?...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#codedecode #exceptionhandling #javainterviewquestions

Пікірлер: 61
@pradeepn5400
@pradeepn5400 2 жыл бұрын
You are just savior for the developers like me who sticks to a company for a long time only because of not having regular touch with techinical skills. Mam, you are just awesome in explaining things more crisp and clearer. You must deserve more and more subscribers and I just want you to thank in person as I watched most of your videos day and night that helps me to crack interviews in reputed organizations like harman etc. Really loved your work to the core and no thank you will pay the value for your amazing work. WE ARE HERE TO SUPPORT YOU 🙌 KEEP GOING MAM🤩
@CodeDecode
@CodeDecode 2 жыл бұрын
This means a lot to us Pradeep. Thanks a tonnn for supporting us. We can't be more grateful to have you in our code decode family. :)
@yogeshatc
@yogeshatc 2 жыл бұрын
Ever since I started watching your videos, I have been recommending it to anyone who is in the process of job search. Love the way you keep things to the point and technical enough for anyone to easily understand and follow... Please continue the good work and help many more like me to find new jobs. Thanks again 💐
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks a lot Yogesh. This comment made my day. 🙂👍. All hard works seems worth it after this. 🙂 so glad to see you landed at your dream job. Keep learning keep shining Man⭐✨⭐✨⭐✨👏
@akashsaha9366
@akashsaha9366 2 жыл бұрын
Yes!! Please create more videos on spring and hibernate. Good knowledge sharing video.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure akash we will do that
@PriyankaPawar-sl9gl
@PriyankaPawar-sl9gl 2 жыл бұрын
Sure please upload more of videos on exception handling... It wld be really helpful
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Priyanka 🙂👍
@shruthishru3553
@shruthishru3553 2 жыл бұрын
Great videos, I have been suggesting my friends to go through your videos for easy understanding . So please create sequence :)
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks A lot Shruthi 🙂👍
@sourabhjinde8191
@sourabhjinde8191 2 жыл бұрын
Thanks 👍. Please continue videos on the topic
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure sourabh we will create more videos on this
@abhishekatri324
@abhishekatri324 11 ай бұрын
Please make 3rd part of this exception handling series. We are waiting for 3rd part. These videos are very helpful for all the java developers. Thanks😊
@CodeDecode
@CodeDecode 10 ай бұрын
Sure 😊
@mohitsoni2919
@mohitsoni2919 2 жыл бұрын
Great video. Please create customized exception video
@RockMB
@RockMB Жыл бұрын
Mam please cover all other sections of exception handling also. We are eagerly waiting for it.... Thank you in advance 🙂
@urmitabhaumik3017
@urmitabhaumik3017 Жыл бұрын
Please please please create more videos on advance questions of exception handling . Please I have been referring to my friends to watch and like who ever is working in java or searching a job in java
@SamPaulIsaac
@SamPaulIsaac 4 күн бұрын
Thanks team.
@sandeepmajhi8768
@sandeepmajhi8768 Жыл бұрын
Mam make more such videos for exception handling like try with resource, custom exception
@seemahebballi2889
@seemahebballi2889 5 ай бұрын
I just want to know from where this energy to you ma'am 🙏 really great way of explaining things 😊
@CodeDecode
@CodeDecode 5 ай бұрын
Thanks Seema 😊
@harshadaraut4096
@harshadaraut4096 3 ай бұрын
Please create video on different cases of parent and derived class method behaviour when either is throwing exception and if we can increase or reduce exception
@amarthyaseshu683
@amarthyaseshu683 2 жыл бұрын
Thanks
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂👍
@sachinjadhav8759
@sachinjadhav8759 2 жыл бұрын
thanks
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂🙂
@muditranjan3002
@muditranjan3002 2 жыл бұрын
Please create more videos in order to cover whole exception handling section .
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Mudit 🙂👍
@tejashritapare7414
@tejashritapare7414 2 жыл бұрын
Ma'am, please....make a video on how to use hashmap, hashset(implementation of collection) in springboot project.
@poojagaunjhu4244
@poojagaunjhu4244 2 жыл бұрын
Please upload more of videos on exception handling
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Pooja 👍🙂
@start1learn-n171
@start1learn-n171 Жыл бұрын
Tq
@CodeDecode
@CodeDecode Жыл бұрын
👍👍🙂🙂
@vipinb7055
@vipinb7055 10 ай бұрын
Why there is no throws clause in method signature in service when you throw an exception?
@CodeDecode
@CodeDecode 10 ай бұрын
Bcz you are able to handle it then and there with try and catch block
@veronicanissy4006
@veronicanissy4006 Жыл бұрын
every video is sooo good, but i felt this is kinda fast
@challaprashanthreddy9799
@challaprashanthreddy9799 2 жыл бұрын
Hi madam can you please create an video how anonymous inner class is used while using lamda expression like when we use lamda what happens internally?
@mohammedilyas8824
@mohammedilyas8824 2 жыл бұрын
ma'am pls make interview quesns on multithreading
@nupurshukla444
@nupurshukla444 Жыл бұрын
Please make another video to cover the more topics.
@CodeDecode
@CodeDecode Жыл бұрын
Sure we will create it soon
@mrinalsarkar7004
@mrinalsarkar7004 Жыл бұрын
Please make more viodeos on exception handling..
@CodeDecode
@CodeDecode Жыл бұрын
sure mrinal we will upload more videos on exception handling
@lakshmisowjanya9492
@lakshmisowjanya9492 9 күн бұрын
Do we have Exception Handling part 3 video
@saigouni4146
@saigouni4146 4 ай бұрын
I am trying to insert audit log of the exception in catch block when exception occur in try block but it is not inserting into db and it is giving Nosuchelement exception from catch block
@Ravikumar-gj6qw
@Ravikumar-gj6qw Жыл бұрын
do more videos on this
@CodeDecode
@CodeDecode Жыл бұрын
Sure
@mohammedilyas8824
@mohammedilyas8824 2 жыл бұрын
ma'am pls make exception handling questions for fresher interviews
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Ilyas 🙂👍
@dhrutijoshi3701
@dhrutijoshi3701 Жыл бұрын
Where we can find other questions related to this topic ?
@saurabhkawade8568
@saurabhkawade8568 4 ай бұрын
Where do you have to go?? Why that fast?? Awesome content but plz take care of speed.
@varunsiddarth1265
@varunsiddarth1265 2 жыл бұрын
Can you cover the topics like docker,kubernets,unittesting, AWS any topic
@CodeDecode
@CodeDecode 2 жыл бұрын
Yes we will 🙂👍
@vishaldhamde2013
@vishaldhamde2013 Жыл бұрын
Too fast.... I would suggest you to go slow we are not able to get the things so quickly.
@CodeDecode
@CodeDecode Жыл бұрын
Sure Vishal 👍
@vishaldhamde2013
@vishaldhamde2013 Жыл бұрын
@@CodeDecode I appreciate that you are responding to each & every comment and I must appreciate the content that you are picking and explaining everything in detail through this channel. Interested to see more videos. Thank you!
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Vishal. Your suggestions helps us grow. Much appreciated 🙏🙏🙂🙂👍
@Ravikumar-gj6qw
@Ravikumar-gj6qw Жыл бұрын
at time 11:00 mins your very fast can you bit slower in this case
@CodeDecode
@CodeDecode Жыл бұрын
Ok sure
@cineetime1547
@cineetime1547 Жыл бұрын
hi mam i have doubt can u give contact
@CodeDecode
@CodeDecode Жыл бұрын
Sure please mail at codedecodebusiness@gmail.com link is given in channel description too
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 22 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 36 МЛН
Top 25 Microservice Interview Questions Answered - Java Brains
39:54
Top 15 SQL Queries Interview Questions and Answers for Software Testing professionals || Part-B
40:06
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 38 М.