Java exception handling ⚠️

preview_player
Показать описание
Java exception exceptions handling try catch finally

#Java #exception #exceptions #handling #try #catch #finally
Рекомендации по теме
Комментарии
Автор

import
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;

" + z);
}
catch(ArithmeticException e) {
System.out.println("You can't divide by zero! IDIOT!");
}
e) {
System.out.println("PLEASE ENTER A NUMBER OMFG!!!");
}
catch(Exception e) {
went wrong");
}
finally {
scanner.close();
}

}
}

BroCodez
Автор

Your channel is really helpful. Hope you will continue with this. Don't stop, bro!

alexshepel
Автор

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

jamesarden
Автор

Really like your clear short presentations, thank you. Keep up the good work!

andrevandenheever
Автор

I appreciate how you explain the important concepts in a very simple and brief manner. Try block, catch block and finally.Thank you

paulinewachira
Автор

bro you are so underrated, you cleared things up so much after my lecture

huzaifafaisal
Автор

You are the best teacher! Now I understand why different exceptions are used.

cuca
Автор

Clear and concise as always. Thanks bro. You're at 999k subs as of today! Congrats on (inevitably) hitting 1 mil!!!

miyaspapa
Автор

No cap the best straightforward and simple tutorials ever

stephenbond
Автор

You are really amazing to explain everything. Never stop to make videos!

adityasharma
Автор

I really like how basic it all looks like, just for people to understand the concept. Thx bro!

Edna_Konrad
Автор

One of my favorite channels for java on Youtube!!

kayleighrenner
Автор

I really love java ..U made it more fun and interesting..THANKS BRO!

skl
Автор

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!

rajneelram
Автор

Amaaazzzing tutorials, so helpful. Don't stop making tutorials please!

kristynicole
Автор

Great videos bro. Love that you cover so much in one Channel. Keep it up Bro!

chillwavefrequency
Автор

That's quite useful, thanks a lot for a video!

ivanpryhorshnia
Автор

Thank you Bro code for the amazing tutorials, they are a life saver.

Garrison
Автор

Explained so simply. I really appreciate it.
Confidence in Ability to Learn Information . . . Restoring(45%) . . . (99%). . .

gutside
Автор

very helpful. i never understood these try catch stuff before. finally i understand. thanks ma bro

omersond