No video

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

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/u...
Course Description Video :
yt.openinapp.c...
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 : www.youtube.co...
LinkedIn : / codedecodeyoutube
Instagram : / codedecode25
#codedecode #exceptionhandling #javainterviewquestions

Пікірлер: 61

  • @pradeepn5400
    @pradeepn54002 жыл бұрын

    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
    @yogeshatc2 жыл бұрын

    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
    @akashsaha93662 жыл бұрын

    Yes!! Please create more videos on spring and hibernate. Good knowledge sharing video.

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure akash we will do that

  • @abhishekatri324
    @abhishekatri324 Жыл бұрын

    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

    11 ай бұрын

    Sure 😊

  • @shruthishru3553
    @shruthishru35532 жыл бұрын

    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 🙂👍

  • @PriyankaPawar-sl9gl
    @PriyankaPawar-sl9gl2 жыл бұрын

    Sure please upload more of videos on exception handling... It wld be really helpful

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure Priyanka 🙂👍

  • @SamPaulIsaac
    @SamPaulIsaacАй бұрын

    Thanks team.

  • @sourabhjinde8191
    @sourabhjinde81912 жыл бұрын

    Thanks 👍. Please continue videos on the topic

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure sourabh we will create more videos on this

  • @harshadaraut4096
    @harshadaraut40964 ай бұрын

    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

  • @seemahebballi2889
    @seemahebballi28896 ай бұрын

    I just want to know from where this energy to you ma'am 🙏 really great way of explaining things 😊

  • @CodeDecode

    @CodeDecode

    6 ай бұрын

    Thanks Seema 😊

  • @urmitabhaumik3017
    @urmitabhaumik30172 жыл бұрын

    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

  • @challaprashanthreddy9799
    @challaprashanthreddy97992 жыл бұрын

    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?

  • @saigouni4146
    @saigouni41465 ай бұрын

    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

  • @vipinb7055
    @vipinb705511 ай бұрын

    Why there is no throws clause in method signature in service when you throw an exception?

  • @CodeDecode

    @CodeDecode

    11 ай бұрын

    Bcz you are able to handle it then and there with try and catch block

  • @RockMB
    @RockMB2 жыл бұрын

    Mam please cover all other sections of exception handling also. We are eagerly waiting for it.... Thank you in advance 🙂

  • @mohitsoni2919
    @mohitsoni29192 жыл бұрын

    Great video. Please create customized exception video

  • @sandeepmajhi8768
    @sandeepmajhi87682 жыл бұрын

    Mam make more such videos for exception handling like try with resource, custom exception

  • @mohammedilyas8824
    @mohammedilyas88242 жыл бұрын

    ma'am pls make exception handling questions for fresher interviews

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure Ilyas 🙂👍

  • @nupurshukla444
    @nupurshukla444 Жыл бұрын

    Please make another video to cover the more topics.

  • @CodeDecode

    @CodeDecode

    Жыл бұрын

    Sure we will create it soon

  • @poojagaunjhu4244
    @poojagaunjhu42442 жыл бұрын

    Please upload more of videos on exception handling

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure Pooja 👍🙂

  • @lakshmisowjanya9492
    @lakshmisowjanya9492Ай бұрын

    Do we have Exception Handling part 3 video

  • @muditranjan3002
    @muditranjan30022 жыл бұрын

    Please create more videos in order to cover whole exception handling section .

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure Mudit 🙂👍

  • @tejashritapare7414
    @tejashritapare74142 жыл бұрын

    Ma'am, please....make a video on how to use hashmap, hashset(implementation of collection) in springboot project.

  • @amarthyaseshu683
    @amarthyaseshu6832 жыл бұрын

    Thanks

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    🙂👍

  • @sachinjadhav8759
    @sachinjadhav87592 жыл бұрын

    thanks

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    🙂🙂

  • @start1learn-n171
    @start1learn-n1712 жыл бұрын

    Tq

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    👍👍🙂🙂

  • @varunsiddarth1265
    @varunsiddarth12652 жыл бұрын

    Can you cover the topics like docker,kubernets,unittesting, AWS any topic

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Yes we will 🙂👍

  • @mrinalsarkar7004
    @mrinalsarkar7004 Жыл бұрын

    Please make more viodeos on exception handling..

  • @CodeDecode

    @CodeDecode

    Жыл бұрын

    sure mrinal we will upload more videos on exception handling

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw2 жыл бұрын

    do more videos on this

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Sure

  • @dhrutijoshi3701
    @dhrutijoshi3701 Жыл бұрын

    Where we can find other questions related to this topic ?

  • @mohammedilyas8824
    @mohammedilyas88242 жыл бұрын

    ma'am pls make interview quesns on multithreading

  • @saurabhkawade8568
    @saurabhkawade85685 ай бұрын

    Where do you have to go?? Why that fast?? Awesome content but plz take care of speed.

  • @veronicanissy4006
    @veronicanissy40062 жыл бұрын

    every video is sooo good, but i felt this is kinda fast

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw2 жыл бұрын

    at time 11:00 mins your very fast can you bit slower in this case

  • @CodeDecode

    @CodeDecode

    2 жыл бұрын

    Ok sure

  • @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 🙏🙏🙂🙂👍

  • @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

Келесі