Available permits

Report a typo

Imagine you are writing a multithreading application using semaphores, and you have the following code snippet from your app:

Semaphore semaphore = new Semaphore(10);
semaphore.acquire();
semaphore.acquire();
semaphore.tryAcquire();

How many permits are left after this snippet is executed?

Enter a number
___

Create a free account to access the full topic