Java AtomicInteger decrementAndGet() methodThe decrementAndGet() method of Java AtomicInteger class subtracts one from the given value and returns the value after substraction. SyntaxReturnIt returns the updated value. Example 1Test it NowOutput: the value after decrement: 9 Example 2Test it NowOutput: the value after decrement: -1 Example 3Test it NowOutput: the value after decrement:-3 Example 4Test it NowOutput: the value after decrement: -2 Example 5Test it NowOutput: the value after decrement: 0 Next TopicJava AtomicInteger |
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