DoubleAccumulator reset() method in Java with Examples
The Java.DoubleAccumulator.reset() is an inbuilt method in java that resets variables maintaining updates to the identity value. It means it only returns the reset value and does not takes any parameter. The return type is int.
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.
public void reset()
Parameters: The method does not accepts any parameter.
Return Value: The method does not returns anything.
Below programs illustrate the above method:
DoubleAccumulator before reset: 12.0 DoubleAccumulator after reset: 0.0
DoubleAccumulator before reset: 62.0 DoubleAccumulator after reset: 0.0