Új hozzászólás Aktív témák
-
válasz
Ablakos
#12026
üzenetére
Remelem nem gond az angol:
Catch Block
You can add a catch block to a try-with-resources block just like you can to a standard try block. If an exception is thrown from within the try block of a try-with-resources block, the catch block will catch it, just like it would when used with a standard try construct.Before the catch block is entered, the try-with-resources construct will attempt to close the resources opened inside the try block. In case an exception is thrown when attempting to close one of the resources, these exceptions will be available from the exception's getSuppressed() method inside the catch block. Here is an example of a Java try-with-resources block with a catch block attached:
try(AutoClosableResource resourceOne = new AutoClosableResource("One", true)) {
resourceOne.doOp(true);
} catch(Exception e) {
Throwable[] suppressed = e.getSuppressed();
throw e;
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- LENOVO LEGION 5 15AHP10 (83M0001MHV)
- Apple iPhone 13 Mini 128GB
- Macbook Pro 16" - 2020 gyártás, 6 mag i7, 16/512GB, Radeon 4GB, touchbar - garancia (66)
- Apple Watch Ultra 2 49mm GPS + Cellular - 98%, full dobz - Apple garancia (202)
- Samsung Galaxy Z Flip 5 8/256GB - Makulátlan állapot! - A szállítást állom!
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi


