ANSWER: Let’s define both these terms. Semaphore: A semaphore control access to a shared resource using a counter. The counter measures the number of permits that are allowed. If a counter is zero, then access to the resource is denied. If it is greater than zero, then access to the resource allowed. Every time a …
Tag Archives: semaphore
Java Interview Questions
1. What’s the difference between Abstract vs. Interface? ANSWER: An abstract class can’t be instantiated, but it can be subclassed. An abstract class usually contains abstract and non-abstract methods that subclasses are forced to provide an implementation for. An interface is a completely “abstract class” that is used to group related methods with empty bodies. …