This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void rethrowException(String exceptionName) | |
throws FirstException, SecondException { | |
try { | |
// ... | |
} | |
catch (Exception e) { | |
throw e; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void rethrowException(String exceptionName) throws Exception { | |
try { | |
if (exceptionName.equals("First")) { | |
throw new FirstException(); | |
} else { | |
throw new SecondException(); | |
} | |
} catch (Exception e) { | |
throw e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (IOException|SQLException ex) { | |
logger.log(ex); | |
throw ex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (IOException ex) { | |
logger.log(ex); | |
throw ex; | |
catch (SQLException ex) { | |
logger.log(ex); | |
throw ex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (IOException|SQLException ex) { | |
logger.log(ex); | |
throw ex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (IOException|SQLException ex) { | |
logger.log(ex); | |
throw ex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch (IOException|SQLException ex) { | |
logger.log(ex); | |
throw ex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (dzienTygodnia) { | |
case "Poniedzialek": | |
System.out.println("Początek tygodnia"); | |
break; | |
case "Wtorek": | |
case "Sroda": | |
case "Czwartek": | |
System.out.println("Jeszcze trochę !"); | |
break; | |
case "Piatek": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try ( FileInputStream fin = new FileInputStream("jakisPlik.bin"); | |
ObjectInputStream in = new ObjectInputStream(fin) ) { | |
//cosik | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try ( ObjectInputStream in = new ObjectInputStream(new | |
FileInputStream("jakisPlik.bin")) ) { | |
//tutaj cosik | |
} |