19. Exception Handling in Java with Examples

Поділитися
Вставка
  • Опубліковано 8 чер 2024
  • ➡️ Notes link: Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Notes link there)
    ➡️ Join this channel to get access to member only perks:
    / @conceptandcoding
    Topics which i have covered:
    - What is Exception
    - Exception Hierarchy
    - Uncheck / Runtime Exception
    - Checked / CompileTime Exception
    - How to handle the Exception properly (try, catch, finally, throw, throws)
    - Creating User-Defined Exception class
    - Advantages of Exception Handling
    - Disadvantage of Exception Handling
    Chapters:
    00:00 - Introduction
    00:52 - What is Exception
    07:26 - Exception Hierarchy
    15:48 - Uncheck / Runtime Exception
    22:46 - Checked / CompileTime Exception
    36:34 - Handle the Exception(try, catch, finally, throw, throws)
    58:42 - Creating User-Defined Exception class
    01:01:28 - Advantages of Exception Handling
    01:10:17 - Disadvantage of Exception Handling
    #java #softwareengineer

КОМЕНТАРІ • 70

  • @ankurrajput2367
    @ankurrajput2367 2 місяці тому +5

    we cannot classify into checked and unchecked because its an error but we can say its unchecked bcz it only detected at the runtime ...

  • @Sanjeev.Network
    @Sanjeev.Network 9 місяців тому +4

    Your Explanation is Very Clear as well as in Depth. [Please keep on teaching in Depth.] Thank You Shrayansh Jain.

  • @shubhamrajput37
    @shubhamrajput37 8 місяців тому +6

    Hi Shreyansh, can you suggest some problem lists or assignments which we can practice on our own?

  • @dhivyaviswanathan7604
    @dhivyaviswanathan7604 4 місяці тому +1

    Thanks shreyansh for great explanation

  • @pransam1
    @pransam1 3 дні тому

    Great Explanation !

  • @ssgupto4612
    @ssgupto4612 Місяць тому

    Hey Shrayansh, do the throws keyword after the method all the way upto main() also not break the flow of program??

  • @yuvhrajverma9665
    @yuvhrajverma9665 7 місяців тому +1

    Hi sir I have a doubt in flyweight pattern like in robot eg we are creating only two object one for human type and other for robotic type as they are cached , their extrinsic value is their coordinates now suppose we have created human type robot and set is coordinate (0,0) and now again we have created another human type robot this time we will get same object which we created before from cache and set it's new coordinate (1,1)
    Wouldn't it create a problem becoz coordinate of first object is changed from 0,0 to 1,1 and now the robot from 0,0 will display at 1,1
    Can u please help me to solve this🙏

  • @ashishjaiswal4207
    @ashishjaiswal4207 10 місяців тому +3

    Akshay Saini in javascript and shrayansh Jain in java both are amazing 🚀🚀

  • @codeinshort
    @codeinshort 21 день тому

    Hii sir can we get any practice problems which is at the industry level

  • @Manish-nz4pq
    @Manish-nz4pq 8 місяців тому +2

    Can you add video in stream API in java also i think that is missing in your playlist

  • @sahilsandhu4222
    @sahilsandhu4222 4 місяці тому

    Hi Sir, Please make a video on Exception Handling during Inheritance.

  • @keshavrjaput1522
    @keshavrjaput1522 7 місяців тому +1

    Where is community section ??
    @Concept && Coding

  • @nishantsharma8824
    @nishantsharma8824 10 місяців тому

    thankyou!!!

  • @code4logics
    @code4logics 10 місяців тому +1

    Multithreading and concurrency challenges such as ListenableFuture use cases and Future and semaphores and other locking mechanisms in depth ..please Sir

    • @ConceptandCoding
      @ConceptandCoding  10 місяців тому

      Operators and control flow statement left, after that, collections and multhreading going to start.
      This week planning to cover operators and control flow statement both.

  • @tangellashivareddy196
    @tangellashivareddy196 7 місяців тому

    In case of big applications which are deployed in servers, if runtime exception occurs..which is not handled, will the entire application stops?

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому

      No not entirely application, that particular request will fail only.

    • @souravpatra0175
      @souravpatra0175 Місяць тому

      @@ConceptandCoding But if incase for some logic in application out of memory error occured , then the application server will shut down right ??

  • @sagarsingh-wb8ou
    @sagarsingh-wb8ou 4 місяці тому

    What is type of user defined exception if extended from Exception class , checked or unchecked?

    • @ConceptandCoding
      @ConceptandCoding  4 місяці тому

      ack of the question

    • @sagarsingh-wb8ou
      @sagarsingh-wb8ou 4 місяці тому

      @@ConceptandCoding ?

    • @ConceptandCoding
      @ConceptandCoding  4 місяці тому

      @@sagarsingh-wb8ou In Java, if a user-defined exception class extends the Exception class, it is considered a checked exception.
      at compile time its checked

  • @rr45creation86
    @rr45creation86 7 місяців тому +1

    sir where u put the notes.....?
    pls share the link

  • @darliy647
    @darliy647 10 місяців тому +1

    Bro can you please cover multithreading, collections and streams

    • @ConceptandCoding
      @ConceptandCoding  10 місяців тому +1

      After one more video (control flow statements) i am about to start collections, multi threading unit test cases

    • @darliy647
      @darliy647 10 місяців тому

      @@ConceptandCoding streams also if possible

    • @ConceptandCoding
      @ConceptandCoding  10 місяців тому

      @@darliy647 it will come under collections

    • @darliy647
      @darliy647 10 місяців тому

      @@ConceptandCoding love you bro 😀

  • @yuvhrajverma9665
    @yuvhrajverma9665 7 місяців тому

    Hi sir I have asked this question previously plz reply sir
    In command pattern we have an invoker, but the client can directly use command and pass the receiver to command there is still lose coupling between client and command.
    Invoker can only be used for undo operation if we don't want to have undo operation then I think there is no need of invoker.
    And the uml that I have seen client doesn't have HAS-A relationship with invoker

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому

      No, if client can directly give Command, then it has tight couple with command class.
      If suppose any command giving process change, client has to make the changes too.
      That's the last thing which we wanted (i e to make client changes).
      That's why invoker is added, it's just an abstraction layer for client, so that in future any thing changes it will lead to change in 1 place i.e invoker, bcoz you can have multiple clients but invoker class would be 1.
      Hope that clarifies

    • @yuvhrajverma9665
      @yuvhrajverma9665 7 місяців тому

      @@ConceptandCoding sir can u plz give me any example of how command giving process change effects client, in chat gpt i have searched it says we can use command pattern without invoker for simple design

    • @yuvhrajverma9665
      @yuvhrajverma9665 7 місяців тому

      @@ConceptandCoding sir please reply, i am stucked in this pattern🥹

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому

      @@yuvhrajverma9665 Yuvhraj, then without invoker it won't be considered as Command pattern, and definitely you can solve the problem without invoker or even without using any design pattern, usage of design pattern is not mandatory.
      Consider very simple example: let's say i changed the command method name from "switchOnAC" to "turnOnAC" , will this impact client? Yes , client has to change the name too, what if you have 1000s of clients, will you change all?
      If you have mediator like invoker, you have to change only at invoker and clients remain un impacted

    • @yuvhrajverma9665
      @yuvhrajverma9665 7 місяців тому

      @@ConceptandCoding sir and last question 🥹 in uml why there is no HAS-A relationship between client and invoker as client has invoker reference

  • @ashishjaiswal4207
    @ashishjaiswal4207 10 місяців тому

    Error is unchecked exception, as it's throws error during runtime only.

  • @mhaesh
    @mhaesh 7 місяців тому

    I tried couple of times to join membership But my payment got failed. Can you please help me on this

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому

      Hi, generally payment and all is youtube feature, could you pls msg youtube support service, they might be able to help you buddy

  • @user-rg9wt4qp5u
    @user-rg9wt4qp5u 7 місяців тому +2

    No bro not practicing ,how to practice pls tell that also😢

  • @billion_dreams__7787
    @billion_dreams__7787 7 місяців тому

    Bhaiya got paytm offer.. thnku so much

  • @vishalrajiwade6964
    @vishalrajiwade6964 7 місяців тому +1

    Hello brother,
    Are you also going to start spring & spring boot series, as it will help a lot and one can learn everything starting from java to spring boot.
    Thank you for these videos.

  • @phanijallipalli
    @phanijallipalli 6 місяців тому

    if you had provided notes, it would have been the best course..i think it would be helpful since you put these videos for members only.

    • @ConceptandCoding
      @ConceptandCoding  6 місяців тому

      added the notes link in the description, and here too notebook.zohopublic.in/public/notes/u3i1se54e2f3438a84f42bec26cf3336a5226
      sorry missed to add that previously.

    • @phanijallipalli
      @phanijallipalli 6 місяців тому

      @@ConceptandCoding i dont know you added to remaining videos, if not, plz try to add and correct me if i am wrong

  • @HemanthKumarNandigama
    @HemanthKumarNandigama 7 місяців тому

    Hey hi, Where can find the notebook link?

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому +1

      I have shared in the description section

    • @HemanthKumarNandigama
      @HemanthKumarNandigama 7 місяців тому

      ​@@ConceptandCoding hey , i like the way you teach. Thanks for making this playlist.
      I cannot see the link in description for this video and few other videos as well.
      Could you please check.

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому +1

      @@HemanthKumarNandigama ack, i will check and add

    • @HemanthKumarNandigama
      @HemanthKumarNandigama 7 місяців тому

      @@ConceptandCoding Thanks for helping

    • @rohangupta4290
      @rohangupta4290 6 місяців тому

      @@ConceptandCoding any update when you will be adding the notes. It would be very helpful in revising the concepts. Thanks in advance.

  • @sumitroy7817
    @sumitroy7817 10 місяців тому

    try{ method1();} finally{} lets say method1() throws runtime exception and there's no catch block to catch exception. will finally block get executed. I think program will stop abruptly and finally block will not get executed.

    • @ConceptandCoding
      @ConceptandCoding  10 місяців тому

      Finally block will get executed.
      But do try it out.

    • @sumitroy7817
      @sumitroy7817 10 місяців тому

      @@ConceptandCoding for unchecked, no catch block is needed and finally executes before program ends abruptly. for checked, throws is mandatory both in exception thrown method and from called method, if there's no catch.

  • @car_holic1995
    @car_holic1995 8 місяців тому

    bhai your videos are explained in detail but you are not using any editor for the example of the topic..this does not boost the confidence of the viewer...please make videos in which you do coding also with the concept.

    • @ConceptandCoding
      @ConceptandCoding  8 місяців тому +1

      Sure

    • @car_holic1995
      @car_holic1995 8 місяців тому

      @@ConceptandCoding thanks bhai...milte hn sham ko..topmate pe scheduled h meeting 9:30 ki 😄

  • @umairalvi7382
    @umairalvi7382 Місяць тому

    font of code is very very small

  • @thevagabond85yt
    @thevagabond85yt 7 місяців тому

    Bhai sahab apne pure video me Arithmetic ko Arth-matic bol bol ke na kan ke gaan faad di...

    • @ConceptandCoding
      @ConceptandCoding  7 місяців тому

      :) yes I am working on my pronunciation. Thanks for pointing out. I will take care of it in future.