Java Phaser register() MethodThe register() method of Phaser class is used to add the new un-arrived party in the phaser. This method generates no effect and returns the negative value if the phasor is terminated. SyntaxReturnIt returns the phase number of registered parties. ThrowsIllegalStateException - this Exception is thrown when the number of registered parties is more. Example 1Test it NowOutput: Phaser Object is register... Initial Phase count is 0 Thread-0 arrived Example 2Test it NowOutput: Phaser Object is register... Initial Phase count is 0 Thread is sleeping Thread-0 arrived Thread-2 arrived Final Phase count after arrival of Thread is 1 Thread-3 arrived Thread-1 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