Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- Integer x = null;
- int liczba;
- try {
- liczba = 10 / 0;
- }catch (ArithmeticException e) {
- System.out.println("Nieprawidłowa operacja arytmetyczna");
- System.out.println(e);
- }
- try{
- x/=2;
- }catch (NullPointerException e){
- System.out.println("Niezainicjowana zmienna");
- System.out.println(e);
- } catch(Exception e){
- System.out.println("Błąd ogólny");
- System.out.println(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement