Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication1;
- public class JavaApplication1 {
- public static void main(String[] args) {
- try{
- warunki n = new warunki();
- n.WywalBlad(7);
- System.out.println("Nie znalazłem błędu");
- }catch (Exception e){
- System.out.println("Znalazlem Bląd");
- e.printStackTrace(System.out);
- }
- }
- }
- //------------------------------------------------
- package javaapplication1;
- public class warunki {
- public void WywalBlad(int a) throws Exception{
- if(a==2) throw new Exception("Wykryto liczbe 2");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement