Java AtomicLong getAndAdd() MethodThe getAndAdd() method of Java AtomicLong class adds a number to the AtomicLong but returns the value the AtomicLong had before the value was added. SyntaxParametersdelta - The value to add Return valueThe previous value Example 1Test it NowOutput: 0 Example 2Test it NowOutput: 10 Example 3Test it NowOutput: -5 Example 4Test it NowOutput: -20 Next TopicJava Double |
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