Are Locks auto-closeable? That is, instead of: Lock someLock = new ReentrantLock(); someLock.lock(); try { // … } finally { someLock.unlock(); } …can I say: try (Lock someLock = new …
Are Locks auto-closeable? That is, instead of: Lock someLock = new ReentrantLock(); someLock.lock(); try { // … } finally { someLock.unlock(); } …can I say: try (Lock someLock = new …