Great job on explaining this. I am in my second semester of my software development program and I was working all day on my assignment in for my Java class. I am 35 and going back to school with no programming experience at all. Thanks to your video I got a way better understanding of this and it helped finish my assignment. I needed a few if statements but I got it covered! Thanks dude!
@xxaviersanchezz-personal6 жыл бұрын
Dude, I honestly love all your tutorials! I was looking for some tutorials online and I was like boring... boring... boring... BINGO! I love this channel.
@gunnarkennedy32925 жыл бұрын
boring boring maybe no boring possible BINGO bro your clown
@dartpit5 жыл бұрын
@@gunnarkennedy3292 hes bare funny what do u mean??
@chrisschneider4226 Жыл бұрын
I agree, I love this channel.
@yankswap2 ай бұрын
5 years ago… how’s your coding journey going since then?
@omarkhan52234 жыл бұрын
Thanks Mike, this really helped me out despite programming for almost 5 years!
@jcperez79255 жыл бұрын
who the hell could dislike such an exceptional tut video? probably a competitor lol
@EuroUser15 жыл бұрын
My constructive criticism: Catching exceptions for the sake of catching them is not a good idea. You should classify exceptions in two groups: expected exceptions (one can expect that some users will provide a wrong input) and unexpected (you can't expect that an array will go out of boundaries, deep inside your code). If the exception is expected, you should provide a path for the program to recover and keep working. Like asking the user for new input. If the exception is unexpected, you should log it, probably let your program crash, and fix your code later. So that the exception is properly handled or no longer possible, after the fix. For instance, if a bank transaction throws an unexpected exception, it's better to abort the transaction altogether, rather than giving away your money without sufficient guarantees. In fact, the exception may be due to a hacker who is tampering with your interface in order exploit bugs. In general, the checked/unchecked labelling that Java provides for exceptions is a good start for your expected/unexpected classification. However, a wrong-input exception that may be expected (when the input is provided by a human) can come out of the blue when that same input is provided by a database (which is not supposed to make that kind of mistake).
@yankswap2 ай бұрын
In your example of telling the user it was the wrong input and asking for a valid input, what if they then entered the wrong input again? Should you catch and throw another Exception? How far down the rabbit hole does it go? Or is there a better way where you can prompt the user to keep entering inputs until a valid one is entered?
@EuroUser12 ай бұрын
@@yankswap There is a way to keep the user inside a loop, until a valid input is entered. But I can't remember the syntax details. I wrote the original comment more than five years ago, and I stopped programming shortly after. I found a different job that suited my needs better. So I have forgotten much of my Java, now.
@sarahy59913 жыл бұрын
lmao. "You put in the wrong stuff. How dare you??" always great to learn AND laugh.Thanks :)
@humayunhimu60452 жыл бұрын
Hi Mike, this is just mind blowing delivery!!!
@InSterquiliniisInvenitur4 жыл бұрын
This is a great supplement to the material that I am learning now. Thanks for making this video!
@ishansthakuri3 жыл бұрын
You deserve more money then my programming teacher.
@Abby-fh7hv3 жыл бұрын
You are the best, thank you so much for these videos.
@shahrzadmaftoun58313 жыл бұрын
Thanks Mike! Could you please explain the difference between throw and throws and when we use them in a video?
@shantanu9254 жыл бұрын
I just can't thank you enough!
@ousmandibbasey89332 жыл бұрын
very good lecture
@octoii24182 жыл бұрын
Thanks, I've been struggling to understand the concept of the try and catch exception.
@RealNaps6 жыл бұрын
Mastering java
@programpioneer93034 жыл бұрын
it's very nice example (try/catch )-kindly give some more example .and thank you again boss
@إسماعيل-ط6خ3ض3 жыл бұрын
Thanks Mike.
@nicolahcm3 жыл бұрын
resume: 1) catching exceptions 2) can catch some speficic type of exceptions ( catch ( typeofexc e) ...) 3) errors are different from exceptions: are more bad than exceptions. 4) do not catch errors, not reccomended.
@martinkottaram53554 жыл бұрын
hear after @3:55
@ahmaddawood96915 жыл бұрын
EXCELLENT
@thealchemist97812 жыл бұрын
Golas~monitor errors ~no eexecution and handle them
@andretheruler7142 жыл бұрын
thank you kind sir
@nobleinexile42964 жыл бұрын
Thanks Mike!
@aldreinmendiola25432 жыл бұрын
How can I input this Try/Catch in your last video named Building a Multiple Choive Quiz. I think it would fit perfectly there
@douglasbelton32777 жыл бұрын
I feel that this topic could get "real complex, real fast." Is it possible for us to add additional functionality after the "catch" criteria is met? I am sure there is an easy way to reset to the System.out.println("enter a number: "); part of the code after the try/catch has prevented the code from failing, I just wonder what that way is.
@gunnarkennedy32925 жыл бұрын
cough cough while loop! for loop maybe if your good :)
@ninabohm15353 жыл бұрын
Great video, t!hank you
@fzdz40694 жыл бұрын
How to use TRY/CATCH inside a nested FOR loop so it wouldn't stop the program or print out nonsense?
@mouhsineomar43834 жыл бұрын
I think that it will stop the program and get out of the loop to throw the exception
@Nbak-cw7jx3 жыл бұрын
How about an exception if you input number instead of a letter? is there any?
@Njekt3 жыл бұрын
I love you.
@aj987675 жыл бұрын
Can someone provide in the reply section some further and/or more advance knowledge about using try and catch? Maybe counteractions for most usually encountered problems with exceptions and errors? It would be a great help!
@Antigashlighting Жыл бұрын
S:get a number from user E:whats went wrong /class in java /data type ~store
@nikolasioakimidis30034 жыл бұрын
The only thing I dont understand is what e is on "exception e"
@scottisitt4 жыл бұрын
I think it's just a letter assigned as a variable.... like int i.
@imranfaroouq97414 жыл бұрын
2:15 huhhuu lol.....
@shamikchakraborty33414 жыл бұрын
i came here to learn why "throws" is used.
@stevenshrii2 жыл бұрын
Catch(arrayindexoutofboundsexception e | input ismatchexception) e)
@vitor16783 жыл бұрын
Show your picture on thumbnail, this way people who like your vids will find them faster.
@Antigashlighting Жыл бұрын
}catch (Throwable e){ }catch (Error e){
@Antigashlighting Жыл бұрын
Int [ ] numbs={1,2,3}; System.out.println (nums[5]); System.out.print ("enter a number"); Hasilya Exception in thread "main" java.lang.ArrayIndexOutOfBondExeption
@Antigashlighting Жыл бұрын
Scanner keyboardInput=New Scanner (system.in); System.out.println ("enter a number"); Scanner keyboardInput=New Scanner (system.in); System.out.println ("enter a number"); double num =keyboard input.nextDouble( ); }catch (Exeption e) { System.out.println("invalid Input"); Hasilnya Enter a number :a Invalid input System.out.println (e); Hasilnya Enter a number :a Java.util.InputMissmatch exception