Exception Handling | C# | Tutorial 24

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 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.

ความคิดเห็น • 119

  • @thugerrish
    @thugerrish 5 ปีที่แล้ว +109

    This series deserves so many more views than this!

  • @clarissagonzales7014
    @clarissagonzales7014 4 ปีที่แล้ว +62

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

    • @shonshon
      @shonshon 3 ปีที่แล้ว +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 4 ปีที่แล้ว +14

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

  • @knockedgoose4206
    @knockedgoose4206 ปีที่แล้ว +3

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

  • @cristinemariel.teruel5161
    @cristinemariel.teruel5161 3 ปีที่แล้ว +2

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

  • @sinapazhwak8976
    @sinapazhwak8976 3 ปีที่แล้ว +5

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

  • @austinnotes7906
    @austinnotes7906 2 ปีที่แล้ว

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

  • @armanbecirovic2238
    @armanbecirovic2238 ปีที่แล้ว +2

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

  • @ManuelGraphFilms
    @ManuelGraphFilms 3 ปีที่แล้ว +3

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

  • @gargoyled_drake
    @gargoyled_drake 3 ปีที่แล้ว

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

  • @mubeenhassan2387
    @mubeenhassan2387 4 ปีที่แล้ว +2

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

  • @arrensantos4869
    @arrensantos4869 4 ปีที่แล้ว +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?

  • @Saskamon
    @Saskamon 2 ปีที่แล้ว

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

  • @joshuabharath6774
    @joshuabharath6774 3 ปีที่แล้ว

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

  • @study-zl3it
    @study-zl3it 2 ปีที่แล้ว +1

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

  • @fcolell
    @fcolell 4 ปีที่แล้ว +1

    Thanks Mike for explaining so clearly exception

  • @stoka43
    @stoka43 2 ปีที่แล้ว

    Thanks mike, you have just got yourself a new subscriber

  • @alexfila2619
    @alexfila2619 2 ปีที่แล้ว

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

  • @piki217
    @piki217 2 ปีที่แล้ว

    The best tutorial video i have seen yet

  • @sadeghmirzaee8258
    @sadeghmirzaee8258 3 ปีที่แล้ว

    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 4 ปีที่แล้ว

    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.

  • @scottisitt
    @scottisitt 4 ปีที่แล้ว

    This was awesome, Mike!

  • @sonayorayomide7418
    @sonayorayomide7418 ปีที่แล้ว

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

  • @guywnoname
    @guywnoname ปีที่แล้ว

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

  • @usaamahpatel9577
    @usaamahpatel9577 3 ปีที่แล้ว

    Watching this in 2021. Absolutely wonderful explanation!!!

  • @rayoh2011
    @rayoh2011 3 ปีที่แล้ว

    Very nice Mike! Thank you!

  • @bonganisedibe4636
    @bonganisedibe4636 4 ปีที่แล้ว +2

    far better than my lecture! Thanks Man

  • @athariealfuraih8115
    @athariealfuraih8115 3 ปีที่แล้ว

    Great explanation! Thank you so much

  • @alkam0421
    @alkam0421 4 ปีที่แล้ว +2

    I FINALLY UNDERSTAND! thank you so much :')

  • @tomslater8374
    @tomslater8374 3 ปีที่แล้ว

    super clear and helpful, thank you!

  • @muhammadrizwanmalik8956
    @muhammadrizwanmalik8956 6 หลายเดือนก่อน

    very clear to unerstand! thanks

  • @futuregeneration8348
    @futuregeneration8348 ปีที่แล้ว

    Your way of teaching is great thank you so much

  • @rostikproduction2460
    @rostikproduction2460 3 ปีที่แล้ว

    Really nice video! Thumbs up!

  • @gallacticvr4157
    @gallacticvr4157 2 ปีที่แล้ว

    EXACTLY WHAT I NEEDED THANK YOU

  • @otetumooluwaseun3948
    @otetumooluwaseun3948 หลายเดือนก่อน

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

  • @jinju3785
    @jinju3785 2 ปีที่แล้ว

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

  • @xtrinsicdesign
    @xtrinsicdesign 3 ปีที่แล้ว

    Really helped me out tonight, ty

  • @weebofthesouth4113
    @weebofthesouth4113 3 ปีที่แล้ว

    "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.

  • @user-ny4nc5wd8n
    @user-ny4nc5wd8n 2 ปีที่แล้ว

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

    • @upcom1ng116
      @upcom1ng116 2 ปีที่แล้ว

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

  • @lovegeneration8464
    @lovegeneration8464 3 ปีที่แล้ว

    Well explained, thank you 🙂 👍

  • @davidksoku4860
    @davidksoku4860 3 ปีที่แล้ว

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

  • @olmusic7856
    @olmusic7856 ปีที่แล้ว +1

    great explaniation bro tnx alot

  • @thanhhaminh9383
    @thanhhaminh9383 3 ปีที่แล้ว

    this video is very clearly, thank you

  • @tripernnn5581
    @tripernnn5581 2 ปีที่แล้ว

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

  • @dariorud
    @dariorud 3 ปีที่แล้ว

    Brilliant video!

  • @adrianasilveira4561
    @adrianasilveira4561 3 ปีที่แล้ว

    Great explanation. Thank you

  • @milos1799
    @milos1799 2 ปีที่แล้ว +1

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

  • @dudem5447
    @dudem5447 4 ปีที่แล้ว +1

    awesome, man, thanks!

  • @triangle4studios
    @triangle4studios 3 ปีที่แล้ว

    This was exceptional

  • @Rd.2535
    @Rd.2535 9 หลายเดือนก่อน

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

  • @user-kb3un1dx7u
    @user-kb3un1dx7u 3 หลายเดือนก่อน

    Loved it!

  • @MrJo0ntee
    @MrJo0ntee 2 ปีที่แล้ว

    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!

  • @Jason-mi3nu
    @Jason-mi3nu 2 ปีที่แล้ว

    Helped me understand it and use it Thx

  • @Ethan-xj7hb
    @Ethan-xj7hb 10 หลายเดือนก่อน

    ty my bro helped me a ton

  • @trumbaron
    @trumbaron ปีที่แล้ว

    Perfect! Thanks!

  • @jasmin9943
    @jasmin9943 3 ปีที่แล้ว

    you are awesome thank you for the video !!

  • @user-hz6ue4tq5g
    @user-hz6ue4tq5g ปีที่แล้ว

    Thank you teacher!

  • @hamzarashid7579
    @hamzarashid7579 3 ปีที่แล้ว

    Thank you for this video

  • @xSAxHellboy1
    @xSAxHellboy1 3 ปีที่แล้ว

    Great video man

  • @simplycoding347
    @simplycoding347 10 หลายเดือนก่อน

    Great work

  • @mweshiols
    @mweshiols 6 หลายเดือนก่อน

    thanks this was well explained

  • @SweetPeachannel
    @SweetPeachannel ปีที่แล้ว +1

    i do love your video ..

  • @HaydenHeun
    @HaydenHeun 4 ปีที่แล้ว +1

    Thank You!

  • @ronenoren8267
    @ronenoren8267 3 ปีที่แล้ว

    Thank you!

  • @dougwarner59
    @dougwarner59 3 ปีที่แล้ว +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.)

  • @Hikizuru
    @Hikizuru 2 ปีที่แล้ว

    Bro. So good.

  • @JC-xc8rx
    @JC-xc8rx 5 ปีที่แล้ว

    excelent!

  • @nandorbacso4625
    @nandorbacso4625 4 ปีที่แล้ว +1

    Thank you man

  • @abdelkiki
    @abdelkiki 3 ปีที่แล้ว

    Thank you so much

  • @abdelrahmanmohamedowis7619
    @abdelrahmanmohamedowis7619 หลายเดือนก่อน +1

    Thank You

  • @u_mpumelelo
    @u_mpumelelo 26 วันที่ผ่านมา

    Thank you bro

  • @eonshade6297
    @eonshade6297 3 ปีที่แล้ว

    Good tutorial

  • @aviperetz1
    @aviperetz1 2 ปีที่แล้ว

    Thanks 👌👍

  • @PopCapMusicTrending
    @PopCapMusicTrending ปีที่แล้ว

    Thank you

  • @matinaminsabouri
    @matinaminsabouri 10 หลายเดือนก่อน

    nice and neat

  • @rsk6929
    @rsk6929 2 ปีที่แล้ว +1

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

    • @thegoodkidboy7726
      @thegoodkidboy7726 2 ปีที่แล้ว

      kowai

    • @rsk6929
      @rsk6929 2 ปีที่แล้ว

      @@thegoodkidboy7726 ?

    • @thegoodkidboy7726
      @thegoodkidboy7726 2 ปีที่แล้ว

      @@rsk6929 people don't like goto very much

    • @rsk6929
      @rsk6929 2 ปีที่แล้ว

      @@thegoodkidboy7726 ok, why

  • @SuperTNT
    @SuperTNT ปีที่แล้ว

    thanks!

  • @Stoicism_self_improvement
    @Stoicism_self_improvement 3 ปีที่แล้ว

    Truly wish you're my teacher

  • @DailyFactmerit
    @DailyFactmerit 2 ปีที่แล้ว

    Thanks sir

  • @redeyz1885
    @redeyz1885 3 ปีที่แล้ว

    Thanks

  • @marklitvin9291
    @marklitvin9291 4 ปีที่แล้ว

    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.

  • @sariepproduction4146
    @sariepproduction4146 ปีที่แล้ว

    Thanks bruh

  • @gdj777
    @gdj777 3 ปีที่แล้ว +1

    Mike! Come back!

  • @jarell2805
    @jarell2805 ปีที่แล้ว

    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

  • @mastinaatumasala
    @mastinaatumasala 3 ปีที่แล้ว

    Super

  • @praveenbhawantha
    @praveenbhawantha 3 ปีที่แล้ว

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

  • @naziayameen9755
    @naziayameen9755 2 ปีที่แล้ว

    thnku

  • @simplyjemelah8276
    @simplyjemelah8276 2 ปีที่แล้ว

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

  • @hydarnasiru2158
    @hydarnasiru2158 3 ปีที่แล้ว

    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?

  • @chamith256
    @chamith256 3 ปีที่แล้ว

    What is the difference between Write and WriteLine?

  • @manoasankad
    @manoasankad 3 ปีที่แล้ว

    Tx

  • @sofianebm7492
    @sofianebm7492 3 ปีที่แล้ว

    i enjoyed it , so i am leaving a comment XD

  • @franciscrypto9143
    @franciscrypto9143 ปีที่แล้ว

    same with if else statement?

  • @janaewelsh8056
    @janaewelsh8056 4 ปีที่แล้ว

    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 3 ปีที่แล้ว +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"

  • @cptsnorkles1037
    @cptsnorkles1037 3 ปีที่แล้ว

    Auto sub

  • @kunaldedhia5502
    @kunaldedhia5502 2 ปีที่แล้ว

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

  • @jakeogsimer9445
    @jakeogsimer9445 4 ปีที่แล้ว

    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 4 ปีที่แล้ว +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 4 ปีที่แล้ว +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 4 ปีที่แล้ว

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

  • @smartacc8745
    @smartacc8745 ปีที่แล้ว

    Hello Mike How Are You Bro ?

  • @aminkoolivand2790
    @aminkoolivand2790 4 ปีที่แล้ว

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

  • @thatonerealguy69
    @thatonerealguy69 ปีที่แล้ว

    Giraffe.exe 😂😂😂