Uncategorized Print Only Even Numbers In Java : Semaphore implementation provided in java is a counting semaphore where semaphore is initialized with permits. In the java program there are two runnable tasks one for printing even numbers and another for printing odd numbers.