Java exception handling ⚠️

  Рет қаралды 127,573

Bro Code

Bro Code

Күн бұрын

Java exception exceptions handling try catch finally
#Java #exception #exceptions #handling #try #catch #finally

Пікірлер: 237
@BroCodez
@BroCodez 4 жыл бұрын
import java.util.InputMismatchException; import java.util.Scanner; public class Main { public static void main(String[] args) { // exception = an event that occurs during the execution of a program that, // disrupts the normal flow of instructions Scanner scanner = new Scanner(System.in); try { System.out.println("Enter a whole number to divide: "); int x = scanner.nextInt(); System.out.println("Enter a whole number to divide by: "); int y = scanner.nextInt(); int z = x/y; System.out.println("result: " + z); } catch(ArithmeticException e) { System.out.println("You can't divide by zero! IDIOT!"); } catch(InputMismatchException e) { System.out.println("PLEASE ENTER A NUMBER OMFG!!!"); } catch(Exception e) { System.out.println("Something went wrong"); } finally { scanner.close(); } } }
@haruamia7931
@haruamia7931 3 жыл бұрын
Why use int not double? cant 5/2 with int... try { System.out.println("Enter a whole number to divide: "); double x = scanner.nextDouble(); System.out.println("Enter a whole number to divide by: "); double y = scanner.nextDouble(); double z = x/y; System.out.println("result: " + z); }
@guytordjman7166
@guytordjman7166 2 жыл бұрын
@@haruamia7931 this will not throw an exception. If y=0 then z is infinity. Arithmetic exception is thrown only when dealing with integer division - give it a try!.
@oscarjosefsson9300
@oscarjosefsson9300 2 жыл бұрын
Excuse my but what is the "e" after Exception? Is e an object? Is there any special reason for calling it e? Is there a risk of creating more than one object since e is used for all the catchers?
@dd0n396
@dd0n396 Жыл бұрын
​@@oscarjosefsson9300 you can name it anything you want. E is just standard
@oscarjosefsson9300
@oscarjosefsson9300 Жыл бұрын
@@dd0n396 Thanks! 👍
@paulinewachira5839
@paulinewachira5839 11 ай бұрын
I appreciate how you explain the important concepts in a very simple and brief manner. Try block ,catch block and finally.Thank you
@alexshepel5599
@alexshepel5599 4 жыл бұрын
Your channel is really helpful. Hope you will continue with this. Don't stop, bro!
@jamesarden7554
@jamesarden7554 3 жыл бұрын
This is by far the best explained java course out there and i have seen loads!!! Concepts i have had trouble with are now no problem thanks to this channel plus i have learned stuff i never even knew java could do
@thewewguy8t88
@thewewguy8t88 Жыл бұрын
honestly i thought bucky from the newboston did a decent job as well. granted i never made it past video 40 lol.
@toxchad
@toxchad Ай бұрын
great simple explaination
@andrevandenheever6740
@andrevandenheever6740 3 жыл бұрын
Really like your clear short presentations, thank you. Keep up the good work!
@cuca3243
@cuca3243 Жыл бұрын
You are the best teacher! Now I understand why different exceptions are used.
@gutside8069
@gutside8069 Жыл бұрын
Explained so simply. I really appreciate it. Confidence in Ability to Learn Information . . . Restoring(45%) . . . (99%). . .
@huzaifafaisal5019
@huzaifafaisal5019 4 жыл бұрын
bro you are so underrated, you cleared things up so much after my lecture
@kayleighrenner829
@kayleighrenner829 3 жыл бұрын
One of my favorite channels for java on KZbin!!
@naledimotsoikha6807
@naledimotsoikha6807 2 жыл бұрын
I spent 3hours in class trying to understand this and you do it in 7min52s ... wow you saves me.
@skl7714
@skl7714 3 жыл бұрын
I really love java ..U made it more fun and interesting..THANKS BRO!
@Edna_Konrad
@Edna_Konrad 2 жыл бұрын
I really like how basic it all looks like, just for people to understand the concept. Thx bro!
@stephenbond9487
@stephenbond9487 2 жыл бұрын
No cap the best straightforward and simple tutorials ever
@adityasharma6132
@adityasharma6132 2 жыл бұрын
You are really amazing to explain everything. Never stop to make videos!
@rochellemellomida9972
@rochellemellomida9972 4 жыл бұрын
Hello bro, i really love watching your videos, these helped me a lot as a self-learner and beginner in java greetings from the Philippines♥♥♥
@BroCodez
@BroCodez 4 жыл бұрын
Glad you like them! Thanks for watching Rochelle!
@omersond4891
@omersond4891 4 жыл бұрын
very helpful. i never understood these try catch stuff before. finally i understand. thanks ma bro
@Thomas10292
@Thomas10292 9 ай бұрын
Best teacher on all of KZbin!!!
@Sobu_us
@Sobu_us 2 ай бұрын
you are very good at it, just I. 7 min you have explain it clearly more than KZbin who does it in 20 min
@miyaspapa5628
@miyaspapa5628 Жыл бұрын
Clear and concise as always. Thanks bro. You're at 999k subs as of today! Congrats on (inevitably) hitting 1 mil!!!
@jafri3
@jafri3 Жыл бұрын
I watched this video to solve a question on hackerank, which I haven't solved in 6 months. It seems easy now, thanks bro
@hemanthneupane8608
@hemanthneupane8608 4 жыл бұрын
I subscribed your channel right away I saw this series. I was having trouble learning java and i had not found any good videos on youtube. Thank you! Your videos are helping me all way out!
@BroCodez
@BroCodez 4 жыл бұрын
thanks for watching Hemanth!
@vklmao8677
@vklmao8677 3 жыл бұрын
Ahhh, a siting at my desk with a coffee ....watching a cool KZbin video about it......and do not have to go through stacks overflow what else is needed....COOL!!!!😎😎
@dianamilenaarchilacordoba4632
@dianamilenaarchilacordoba4632 4 ай бұрын
great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much
@atulgurung6213
@atulgurung6213 8 ай бұрын
Nicely defined about exception bro, i like the way you teach bro...
@JOONWOOKIYOTAKA
@JOONWOOKIYOTAKA 4 ай бұрын
This just helped me out so much. Thank you fellow bro
@amadujalloh4700
@amadujalloh4700 4 жыл бұрын
Geez what is more beautiful than reading Big Java text book and watching the practicals here with my bro? Nothing is better in Java than @Bro code...
@kairavpathak2178
@kairavpathak2178 4 жыл бұрын
I subbed. Ur videos are so easy to understand. Thank god I found your channel. Otherwise I would be lost in the yt coding world
@BroCodez
@BroCodez 4 жыл бұрын
Glad to have you here Kairav!
@kairavpathak2178
@kairavpathak2178 4 жыл бұрын
Could you upload some vids in your gaming channel too? Like maybe once a week if you are busy or something.
@Stella-ic7nc
@Stella-ic7nc 11 ай бұрын
thanks for summarizing what my lecturer spent 1,5h talking about !
@infinitepossibilities2614
@infinitepossibilities2614 3 жыл бұрын
2:22 - Surroud any Dangerous code with the try block. Haha that was amazing bro!
@mpbabu80
@mpbabu80 3 жыл бұрын
Excellent teaching
@arjundas7078
@arjundas7078 6 ай бұрын
Now i know how to handle exception. Thanks bro.
@chillwavefrequency8108
@chillwavefrequency8108 Жыл бұрын
Great videos bro. Love that you cover so much in one Channel. Keep it up Bro!
@cosecE
@cosecE 3 жыл бұрын
recommended your channel to all my juniors
@notahmed6682
@notahmed6682 10 ай бұрын
i really love the way you explained it, thank you..
@fareskamal4145
@fareskamal4145 3 жыл бұрын
thank u i wish every one explains in ur way
@rajneelram4229
@rajneelram4229 3 жыл бұрын
Appreciate how you explain how to put the exception in blocks, I have been trying to find a decent example of how it works with the code portion. Thank you!
@eyobabebe7536
@eyobabebe7536 3 жыл бұрын
Great explanation, i love the way of teaching , keep doing bro
@adarshvardan6825
@adarshvardan6825 Жыл бұрын
your videos are very helpful
@RoxanneGirol
@RoxanneGirol Жыл бұрын
bro, your my go to when my teacher fails me. Thank you.
@lm_slayer1
@lm_slayer1 Жыл бұрын
I passed my exam because of you KINGGGGGGGG
@amada.10
@amada.10 4 жыл бұрын
Hahah I literally like this video, everytime you create a catch function, you don't forget to include a silly word🤪😂😂😂
@helenaa1304
@helenaa1304 Жыл бұрын
Thanks Bro, I really needed this for my comp sci class 👍
@RK_Rom30
@RK_Rom30 2 жыл бұрын
brooo you videos is educational at somehow entertaining hahahaa
@shockwave2477
@shockwave2477 4 жыл бұрын
Great playlist
@kameshwaranr3569
@kameshwaranr3569 10 ай бұрын
God level explanation bro😎
@Garrison86
@Garrison86 2 жыл бұрын
Thank you Bro code for the amazing tutorials, they are a life saver.
@ShermukhammadKarimov
@ShermukhammadKarimov 9 ай бұрын
thanks for clear explanation
@dhmilan6077
@dhmilan6077 2 жыл бұрын
Damn!! What a simple and easy way to teach
@nourialsayed
@nourialsayed 4 жыл бұрын
BEST CHANEL EVER
@Aman-xo4yx
@Aman-xo4yx 11 ай бұрын
my go to java tutorial channel
@avoisavo
@avoisavo 11 ай бұрын
very usefullll
@fire_krystal
@fire_krystal Жыл бұрын
best explanation out there! thanks sm
@trinithvihanga5084
@trinithvihanga5084 11 ай бұрын
goood content
@chrisstuff8235
@chrisstuff8235 2 жыл бұрын
Bien expliqué. Merci Monsieur
@adanskiesabaria
@adanskiesabaria 8 ай бұрын
Nice Bruhh I love Your Video
@danishhussain9642
@danishhussain9642 10 ай бұрын
Great teaching, Bro!
@speklex779
@speklex779 Жыл бұрын
dope video
@PatrickWayne07
@PatrickWayne07 2 жыл бұрын
Thanks Bro!
@anapopova9199
@anapopova9199 2 жыл бұрын
It was interesting and good to know! Thanks 🙂 I will follow you!
@yusufmarzuki3128
@yusufmarzuki3128 7 ай бұрын
good one !!
@danielsullivan5287
@danielsullivan5287 2 жыл бұрын
actually watching this in class to help me on my lab
@adityasharma6132
@adityasharma6132 2 жыл бұрын
continue always
@Ragehunter
@Ragehunter Жыл бұрын
tysm for the examples it was clearly understandable :)
@Bina-y1r
@Bina-y1r 18 күн бұрын
great
@ivanpryhorshnia6854
@ivanpryhorshnia6854 3 жыл бұрын
That's quite useful, thanks a lot for a video!
@kemann3815
@kemann3815 3 жыл бұрын
Another great one 👌
@African_Ninja
@African_Ninja 4 ай бұрын
Last minute studying, thanks bro 😂🔥💔
@alnmet
@alnmet 6 ай бұрын
thx. short and easy to understand
@DetCoAnimeFan
@DetCoAnimeFan 3 жыл бұрын
IDK if anyone cares or not but what I liked the most was the fact that in the thumbnail, Naruhodo is screaming "Exception".
@BroCodez
@BroCodez 3 жыл бұрын
Yes! Somebody understands the reference!
@113_03
@113_03 Жыл бұрын
Thank you bro u really saved my life
@issker8840
@issker8840 11 ай бұрын
love your vids bro!
@AdelitoTeca-mi6xg
@AdelitoTeca-mi6xg 11 ай бұрын
very nice, you´re great on it
@aliaskararzykulov2361
@aliaskararzykulov2361 3 жыл бұрын
good job bro
@lucnahounou
@lucnahounou Жыл бұрын
Thanks!😁
@michael_scarn_
@michael_scarn_ Жыл бұрын
Bro, hats off, thanks a million
@thanhhuyvu4530
@thanhhuyvu4530 3 жыл бұрын
i understood try-catch. Thanks Bro
@gokulprasath4390
@gokulprasath4390 2 жыл бұрын
thnx as alwayas
@airadjurad8934
@airadjurad8934 Жыл бұрын
good explanation :)
@YusufAnsari-z9v
@YusufAnsari-z9v 8 ай бұрын
awesome!
@FarizDarari
@FarizDarari Жыл бұрын
HUGE THANKS!!!
@shukragaming
@shukragaming 2 жыл бұрын
THANKS YOU SAVED MY DAY
@codesloth940
@codesloth940 2 жыл бұрын
Your my hero bro
@danny.3036
@danny.3036 3 жыл бұрын
Thanks, Bro! ☕ You're awesome!
@azerpashahuseynli444
@azerpashahuseynli444 3 жыл бұрын
Thank you Bro, perfect explanation
@dhrubarajroy_0865
@dhrubarajroy_0865 3 жыл бұрын
nice
@МаксимЯрема-е8щ
@МаксимЯрема-е8щ Жыл бұрын
Thanks pal, that was quite helpfull
@cool_huip_
@cool_huip_ 2 жыл бұрын
DROP a COMMENT down below
@Simis999
@Simis999 2 жыл бұрын
Bro doing God's work
@RionHoxha-j9q
@RionHoxha-j9q Жыл бұрын
ur the best
@alanwarthon
@alanwarthon Жыл бұрын
Perfect!, thanks.
@azizt6773
@azizt6773 Жыл бұрын
Bro you are Amazing thank you so much
@salahadinshemsu6186
@salahadinshemsu6186 2 жыл бұрын
Bro!! love you
@fitzsimmons7
@fitzsimmons7 Жыл бұрын
thank you, this was helpful
@farmgatebd7858
@farmgatebd7858 3 жыл бұрын
Your channel will reach to Million subs sooner, i suggest stick to engineering things such as algorithm, system programming, networking algorithm etc as because this is the hard way, very few people working on it, you might be great on it.
@mohammadreza1414
@mohammadreza1414 6 ай бұрын
Appreciate you bro!
@romario92730
@romario92730 3 жыл бұрын
Thanks, Bro!
@minhtetpaing1695
@minhtetpaing1695 3 жыл бұрын
Thank you so much sir.
@steatze
@steatze 3 жыл бұрын
KZbin Algorithm, take this comment and use it to spread this AMAZING channel.
@firsttime8064
@firsttime8064 8 ай бұрын
love u man, thx
Java custom exceptions 🛑
10:05
Bro Code
Рет қаралды 84 М.
Java static keyword ⚡
8:18
Bro Code
Рет қаралды 128 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
you will never ask about pointers again after watching this video
8:03
Exception Handling in Java Tutorial
13:20
Coding with John
Рет қаралды 446 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 921 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 67 МЛН
How to Stop Procrastinating and Finally Take Action
16:31
Ali Abdaal
Рет қаралды 176 М.
Java Exception Handling Tutorial
11:39
Keep On Coding
Рет қаралды 83 М.
C++ Super Optimization: 1000X Faster
15:33
Dave's Garage
Рет қаралды 339 М.
Java super keyword 🦸‍♂️
8:09
Bro Code
Рет қаралды 108 М.
Java Custom Exceptions Tutorial - It's Way Easier Than You Think
14:29
Coding with John
Рет қаралды 175 М.
Checked vs. Unchecked Exceptions in Java Tutorial - What's The Difference?
10:14
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН