The Java.DoubleAccumulator.intValue() is an inbuilt method in java that returns the current value as an int after a narrowing primitive conversion. The initial datatype is double which is explicitly converted into type int without accepting any parameters.
public int intValue()
Parameters: The method does not accepts any parameter.
Return Value: The method returns the current value as an int after a narrowing primitive conversion.
Below programs illustrate the above method:
Old value is: 52.0 Current int value is: 52
Old value is: 64.0 Current int value is: 64
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.