The java.DoubleAdder.add() is an inbuilt method in java that adds the given value to the previous or initial value. When the object of the class is created its initial value is zero.
public void add(double x)
Parameters: This method accepts a single parameter x that specifies the value to be added.
Return Value: The method returns the new value after the addition operation.
Below programs illustrate the above function:
the current value is: 52.0
the current value is: 1.0
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.