Java AtomicLong decrementAndGet() MethodThe decrementAndGet() method of Java AtomicLong class subtracts 1 from the AtomicLong value and returns its value after the subtraction. 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 : 9 Example 3Test it NowOutput: Updated Value : -21 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