AtomicLong intValue() method in Java with examples Last Updated : 29 Jan, 2019 Comments Improve Suggest changes Like Article Like Report The Java.util.concurrent.atomic.AtomicLong.intValue() is an inbuilt method in java that returns the value which is currently stored in the object which is of data-type long by doing a narrowing primitive conversion. Syntax: public long intValue() Parameters: The function does not accepts a single parameter. Return value: The function returns the current value. Below programs illustrate the above method: Program 1: Java // Java program that demonstrates // the intValue() function import java.util.concurrent.atomic.AtomicLong; public class GFG { public static void main(String args[]) { // Initially value as 0 AtomicLong val = new AtomicLong(0); long res = val.intValue(); // Prints the updated value System.out.println("Current value: " + res); } } Output: Current value: 0 Program 2: Java // Java program that demonstrates // the intValue() function import java.util.concurrent.atomic.AtomicLong; public class GFG { public static void main(String args[]) { // Initially value as 18 AtomicLong val = new AtomicLong(18); long res = val.intValue(); // Prints the updated value System.out.println("Current value: " + res); } } Output: Current value: 18 Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicLong.html#intValue-- Comment More infoAdvertise with us Next Article AtomicLong intValue() method in Java with examples G gopaldave Follow Improve Article Tags : Java Java - util package Java-Functions Java-AtomicLong Practice Tags : Java Similar Reads AtomicInteger intValue() method in Java with examples The java.util.concurrent.atomic.AtomicInteger.intValue() is an inbuilt method in java that returns the value which is currently stored in the object which is of data-type int. Syntax: public int intValue() Parameters: The function does not accepts a single parameter. Return value: The function retur 1 min read AtomicLong floatValue() method in Java with examples The Java.util.concurrent.atomic.AtomicLong.floatValue() is an inbuilt method in java which returns the current value of the AtomicLong as a Float data-type after performing primitive conversion. Syntax: public float floatValue() Parameters: The function does not accepts any parameter. Return value: 1 min read Byte intValue() method in Java with examples The intValue() method of Byte class is a built in method in Java which is used to return the value of this Byte object as int. Syntax ByteObject.intValue() Return Value: It returns the value of ByteObject as int. Below is the implementation of intValue() method in Java: Example 1: Java // Java code 2 min read Double intValue() method in Java with examples The intValue() method of Double class is a built in method to return the value specified by the calling object as int after type casting. Syntax: DoubleObject.intValue() Return Value: It return the value of DoubleObject as int. Below programs illustrate intValue() method in Java: Program 1: Java // 2 min read DoubleAdder intValue() method in Java with Examples The java.DoubleAdder.intValue() is an inbuilt method in java that returns the sum() as an int after a narrowing primitive conversion. When the object of the class is created its initial value is zero. Syntax: public int intValue() Parameters: This method does not accepts any parameter. Return Value: 1 min read Like