Exception Handling | C# | Tutorial 24

Sdílet
Vložit
  • čas přidán 24. 06. 2024
  • Source Code - www.giraffeacademy.com/program... This video is one in a series of videos where we'll be looking at programming in C#. The course is designed for new programmers, and will introduce common programming topics using the C# language.
    Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation and much more.

Komentáře • 120

  • @thugerrish
    @thugerrish Před 5 lety +109

    This series deserves so many more views than this!

  • @clarissagonzales7014
    @clarissagonzales7014 Před 4 lety +62

    Clear and straight to the point!
    Even non-programmers can understand this. Thank you so much!!

    • @shonshon
      @shonshon Před 3 lety +4

      well, if you' re learning about how to programming ,then it is also mean that you're already programmer isn't? xD

  • @quantomic1106
    @quantomic1106 Před 4 lety +14

    Straight, informative and to the point. No BS exception caught.
    Love your tutorials.

  • @sinapazhwak8976
    @sinapazhwak8976 Před 3 lety +5

    I wish you were my professor for my entire programming and web-designing studies.

  • @knockedgoose4206
    @knockedgoose4206 Před 2 lety +3

    You are a mentor to a fledgling programmer such as myself. Thank you for making these concepts easy to digest!

  • @cristinemariel.teruel5161

    Thank you, Mike! I understand the topic well and I answer my exercises correctly. I can pass my OOP subject already!!

  • @mubeenhassan2387
    @mubeenhassan2387 Před 4 lety +2

    Thank you so much man.. Finally i understand this ...... keep going man

  • @gargoyled_drake
    @gargoyled_drake Před 3 lety

    i was looking for this, and no one could give a straight answer like you!

  • @scottisitt
    @scottisitt Před 4 lety

    This was awesome, Mike!

  • @austinnotes7906
    @austinnotes7906 Před 2 lety

    Man I'm writing Programming tomorrow and this has made me feel so much at at ease about Exception Handling

  • @ManuelGraphFilms
    @ManuelGraphFilms Před 3 lety +3

    2:55 my guy said illegal hahaha.. you just gained a new sub man

  • @armanbecirovic2238
    @armanbecirovic2238 Před rokem +2

    Thanks for this very useful and simplified explanation. Really like the way you easily explain and present something. :)

  • @piki217
    @piki217 Před 2 lety

    The best tutorial video i have seen yet

  • @joshuabharath6774
    @joshuabharath6774 Před 3 lety

    every since college ive just been listening to your video and its so simple to understand unlike those other C# video lol

  • @Saskamon
    @Saskamon Před 2 lety

    Everytime I see this guy, I can tell for sure that I will learn something. Greath thanks!

  • @study-zl3it
    @study-zl3it Před 2 lety +1

    Hi! I'm studying for my finals and your videos are really helpful, thank you!

  • @bonganisedibe4636
    @bonganisedibe4636 Před 4 lety +2

    far better than my lecture! Thanks Man

  • @arrensantos4869
    @arrensantos4869 Před 4 lety +5

    Hi Mike! I've been looking for a clean explanation of try-catch block and this one was THE BEST so far!!! Thanks a LOT!!! Any chance you can add an explanation about the throw keyword? If there already is, please direct me to it. Also, is there any particular order when laying out catch blocks for multiple exceptions?

  • @fcolell
    @fcolell Před 4 lety +1

    Thanks Mike for explaining so clearly exception

  • @stoka43
    @stoka43 Před 2 lety

    Thanks mike, you have just got yourself a new subscriber

  • @alexfila2619
    @alexfila2619 Před 2 lety

    thanks man, you are great, explained in first 60 sec all I was trying to understand about exceptions. Like!

  • @alkam0421
    @alkam0421 Před 4 lety +2

    I FINALLY UNDERSTAND! thank you so much :')

  • @weebofthesouth4113
    @weebofthesouth4113 Před 3 lety

    "That's illegal!" LOL that made me laugh. Thank you for this video I have an assignment due tonight and this helped me a lot.

  • @rayoh2011
    @rayoh2011 Před 3 lety

    Very nice Mike! Thank you!

  • @sadeghmirzaee8258
    @sadeghmirzaee8258 Před 3 lety

    OMG, man! you throw me some information that is so much useful to me and now I don't have to plan to watch a complete C# intermadiate/advanced tutorial. ( mean that part that you can catch a specific exception type and to something with that, that is like if statements for exceptions. )
    Tnx for that...

  • @HardstylezSuperstaar
    @HardstylezSuperstaar Před 4 lety

    I do wonder how old are you? This dude seems to be some super programmer. I just learn to program in swedish and my school gives me swedish sites to follow.
    But after I found this dudes videos im in here every day to learn. This should be used by all schools in Programming.

  • @sonayorayomide7418
    @sonayorayomide7418 Před rokem

    your videos are really great, watching your videos made me understand c sharp better✊✊

  • @guywnoname
    @guywnoname Před rokem

    straight to the point and very clear and i understood it very well 👍

  • @muhammadrizwanmalik8956
    @muhammadrizwanmalik8956 Před 6 měsíci

    very clear to unerstand! thanks

  • @user-ny4nc5wd8n
    @user-ny4nc5wd8n Před 2 lety

    This 10 min vid helped me more than the book i was reading. Thanks for the help man

    • @upcom1ng116
      @upcom1ng116 Před 2 lety

      What were you reading? So I don't buy it lol

  • @futuregeneration8348
    @futuregeneration8348 Před rokem

    Your way of teaching is great thank you so much

  • @jinju3785
    @jinju3785 Před 2 lety

    dude now i know how to find bugs and errors easily thank you so much❤️❤️

  • @gallacticvr4157
    @gallacticvr4157 Před 2 lety

    EXACTLY WHAT I NEEDED THANK YOU

  • @usaamahpatel9577
    @usaamahpatel9577 Před 3 lety

    Watching this in 2021. Absolutely wonderful explanation!!!

  • @otetumooluwaseun3948
    @otetumooluwaseun3948 Před 2 měsíci

    Wow!
    Amazing!
    I asked for a cake, I got a whole supermarket.
    Thank you for the video.

  • @tomslater8374
    @tomslater8374 Před 3 lety

    super clear and helpful, thank you!

  • @athariealfuraih8115
    @athariealfuraih8115 Před 3 lety

    Great explanation! Thank you so much

  • @rostikproduction2460
    @rostikproduction2460 Před 3 lety

    Really nice video! Thumbs up!

  • @dudem5447
    @dudem5447 Před 4 lety +1

    awesome, man, thanks!

  • @xtrinsicdesign
    @xtrinsicdesign Před 3 lety

    Really helped me out tonight, ty

  • @olmusic7856
    @olmusic7856 Před rokem +1

    great explaniation bro tnx alot

  • @dariorud
    @dariorud Před 3 lety

    Brilliant video!

  • @user-kb3un1dx7u
    @user-kb3un1dx7u Před 3 měsíci

    Loved it!

  • @tripernnn5581
    @tripernnn5581 Před 2 lety

    This was so easy to understand even though im am austrian.....great explanation

  • @milos1799
    @milos1799 Před 2 lety +1

    I'm a bit late, but king, for this turorial, thank you very much!

  • @davidksoku4860
    @davidksoku4860 Před 3 lety

    I love you Man, You are a great teacher ❤️💛💚

  • @MrJo0ntee
    @MrJo0ntee Před 2 lety

    I really love your videos! Im currently taking programming on a highschool level, and my teacher has theese videos, they suck! this video would probobly, not gonna lie, be 40min long! becouse he types with one finger, does misprints and talk so slow. So having theese to look at insted is so good! Thanks!

  • @SweetPeachannel
    @SweetPeachannel Před rokem +1

    i do love your video ..

  • @triangle4studios
    @triangle4studios Před 3 lety

    This was exceptional

  • @Ethan-xj7hb
    @Ethan-xj7hb Před 11 měsíci

    ty my bro helped me a ton

  • @lovegeneration8464
    @lovegeneration8464 Před 3 lety

    Well explained, thank you 🙂 👍

  • @Rd.2535
    @Rd.2535 Před 9 měsíci

    this is what i love and what i went good teaching style

  • @adrianasilveira4561
    @adrianasilveira4561 Před 3 lety

    Great explanation. Thank you

  • @thanhhaminh9383
    @thanhhaminh9383 Před 3 lety

    this video is very clearly, thank you

  • @xSAxHellboy1
    @xSAxHellboy1 Před 3 lety

    Great video man

  • @simplycoding347
    @simplycoding347 Před 10 měsíci

    Great work

  • @HaydenHeun
    @HaydenHeun Před 4 lety +1

    Thank You!

  • @trumbaron
    @trumbaron Před rokem

    Perfect! Thanks!

  • @Jason-mi3nu
    @Jason-mi3nu Před 2 lety

    Helped me understand it and use it Thx

  • @user-hz6ue4tq5g
    @user-hz6ue4tq5g Před rokem

    Thank you teacher!

  • @jasmin9943
    @jasmin9943 Před 3 lety

    you are awesome thank you for the video !!

  • @Hikizuru
    @Hikizuru Před 2 lety

    Bro. So good.

  • @mweshiols
    @mweshiols Před 6 měsíci

    thanks this was well explained

  • @nandorbacso4625
    @nandorbacso4625 Před 4 lety +1

    Thank you man

  • @hamzarashid7579
    @hamzarashid7579 Před 3 lety

    Thank you for this video

  • @ronenoren8267
    @ronenoren8267 Před 3 lety

    Thank you!

  • @JC-xc8rx
    @JC-xc8rx Před 5 lety

    excelent!

  • @abdelrahmanmohamedowis7619
    @abdelrahmanmohamedowis7619 Před měsícem +1

    Thank You

  • @dougwarner59
    @dougwarner59 Před 3 lety +1

    First off the video was very informative and easy to understand....but....
    I still don't understand the point of handling exceptions in the way you describe. exception handling takes up a lot more time than just checking for the errors the normal way. it would be more efficient just to check to see if the second value is a zero or a letter before preforming the code and then let the user know the mistake he or she made. In this particular case I could see possibly using a general exception to catch an error that I may not have thought of; then have the exception send a message telling where exactly the problem occured for trouble shooting purposes.
    Could you give an example of using exception handling when normal error checking would not be able to handle the same problem? (other than using a catch-all general exception as I described earlier.)

  • @abdelkiki
    @abdelkiki Před 3 lety

    Thank you so much

  • @u_mpumelelo
    @u_mpumelelo Před měsícem

    Thank you bro

  • @PopCapMusicTrending
    @PopCapMusicTrending Před rokem

    Thank you

  • @eonshade6297
    @eonshade6297 Před 3 lety

    Good tutorial

  • @Stoicism_self_improvement

    Truly wish you're my teacher

  • @aviperetz1
    @aviperetz1 Před 3 lety

    Thanks 👌👍

  • @rsk6929
    @rsk6929 Před 2 lety +1

    This paired with the goto function works amazingly. i wish we had goto in python

  • @DailyFactmerit
    @DailyFactmerit Před 2 lety

    Thanks sir

  • @jarell2805
    @jarell2805 Před rokem

    How to catch an exception in an a, b, c, and d input only? How to catch numbers and texts such as w,q, t or r

  • @marklitvin9291
    @marklitvin9291 Před 4 lety

    But what about letting the user re-enter the values once again? I did miss that part. Where was it? After the exception was shown.

  • @SuperTNT
    @SuperTNT Před rokem

    thanks!

  • @matinaminsabouri
    @matinaminsabouri Před 10 měsíci

    nice and neat

  • @Ms.Abegail
    @Ms.Abegail Před 20 hodinami

    thank you

  • @praveenbhawantha
    @praveenbhawantha Před 3 lety

    just wanna say it's great and simple
    kudos man!!

  • @redeyz1885
    @redeyz1885 Před 3 lety

    Thanks

  • @hydarnasiru2158
    @hydarnasiru2158 Před 3 lety

    let's say you enter a number and a letter how can throw an exception then make the code loop back to the beginning so you can try again without ending the program?

  • @sariepproduction4146
    @sariepproduction4146 Před rokem

    Thanks bruh

  • @gdj777
    @gdj777 Před 3 lety +1

    Mike! Come back!

  • @simplyjemelah8276
    @simplyjemelah8276 Před 2 lety

    hi do you have a video for C# System.ArithmeticException?

  • @mastinaatumasala
    @mastinaatumasala Před 3 lety

    Super

  • @chamith256
    @chamith256 Před 3 lety

    What is the difference between Write and WriteLine?

  • @naziayameen9755
    @naziayameen9755 Před 2 lety

    thnku

  • @manoasankad
    @manoasankad Před 3 lety

    Tx

  • @sofianebm7492
    @sofianebm7492 Před 3 lety

    i enjoyed it , so i am leaving a comment XD

  • @janaewelsh8056
    @janaewelsh8056 Před 4 lety

    Can someone explain what the e represents? Is it a variable? Does it have to be the letter e or could it be any other letter? Not sure what purpose it serves in the code exactly

    • @baradel9394
      @baradel9394 Před 3 lety +1

      "e" is an object of type Exception or any other one of the types that were in the catch block. Basically, it has all the error information inside of it, such as an error message (e.Message) or the current stack trace (e.Stacktrace). It could have been called any other name, but as convention it usually is called "e" or "ex"

  • @franciscrypto9143
    @franciscrypto9143 Před rokem

    same with if else statement?

  • @jakeogsimer9445
    @jakeogsimer9445 Před 4 lety

    I want the program to ask again for the user's input after the error message prints out on the catch. How can you do that?

    • @mikellwilliams6095
      @mikellwilliams6095 Před 4 lety +3

      You can make a bool variable named something like "response" that starts off FALSE.
      Then, a do-while loop that contains your try-catch which contains your question and input prompts. It will loop while(response = false)
      If everything goes well and dandy and the user has correct inputs... then the last line of code after your prompts is response = true;
      and the do while condition will fail and exit the loop.
      But if the user enters something that breaks the code, then the exception is caught and response is never set to true. So the do-while will keep asking the question. Until the user answers it right.

    • @mikellwilliams6095
      @mikellwilliams6095 Před 4 lety +2

      bool response = false;
      do{
      try{
      // Your Questions and Inputs
      response = true;
      }catch(Exception e)
      // Whatever you want to do with your exception
      }
      }while(response == false)

    • @lancelotxiii9089
      @lancelotxiii9089 Před 4 lety

      @@mikellwilliams6095 Bless you! This is exactly what I came here for!

  • @kunaldedhia5502
    @kunaldedhia5502 Před 2 lety

    How can i handle exceptions globally in console applications? Please help

  • @cptsnorkles1037
    @cptsnorkles1037 Před 3 lety

    Auto sub

  • @smartacc8745
    @smartacc8745 Před rokem

    Hello Mike How Are You Bro ?

  • @aminkoolivand2790
    @aminkoolivand2790 Před 4 lety

    one like is not enough!!!!!!!!!!!!