Java Phaser getPhase() MethodsThe getPhase() method of Phaser class is used to return the number of current phase number. The maximum value of Phase number is Integer.MAX_VALUE. It returns the negative value if the phase number is negative. SyntaxReturnIt returns the current phase number. Otherwise, it returns the negative number if terminated. Example 1Test it NowOutput: Initial Phase count is 0 Thread is sleeping Thread-0 arrived Thread-1 arrived Thread-2 arrived Thread-3 arrived Thread-4 arrived Thread-5 arrived Thread-6 arrived Thread-7 arrived Thread-8 arrived Final Phase count after arrival of Thread is 1 Thread-10 arrived Thread-9 arrived Example 2Test it NowOutput: Phaser Object is register... Initial Phase count is 0 Thread-0 arrived Next TopicJava Phaser |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India