SHARE
TWEET

throwException

Voldemord Mar 21st, 2019 (edited) 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package javaapplication1;
  2.  
  3. public class JavaApplication1 {
  4.  
  5.     public static void main(String[] args) {
  6.         try{
  7.             warunki n = new warunki();
  8.             n.WywalBlad(7);
  9.             System.out.println("Nie znalazłem błędu");
  10.         }catch (Exception e){
  11.             System.out.println("Znalazlem Bląd");
  12.             e.printStackTrace(System.out);
  13.         }
  14.     }
  15.    
  16. }
  17.  
  18.  
  19.  
  20. //------------------------------------------------
  21.  
  22.  
  23. package javaapplication1;
  24.  
  25. public class warunki {
  26.    
  27.     public void WywalBlad(int a) throws Exception{
  28.         if(a==2) throw new Exception("Wykryto liczbe 2");
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top