Java AtomicLong incrementAndGet() MethodThe incrementAndGet() method of Java AtomicLong class increments current value by 1 and return updated value. This method is equivalent to AtomicLong addAndGet(1) method. SyntaxReturnsthe updated value Example 1Test it NowOutput: Updated Value : 1 Example 2Test it NowOutput: Updated Value : 11 Example 3Test it NowOutput: Updated Value : -19 Next TopicJava AtomicLong Class |
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