Explain the long Data Type with an Example.
Advertisements
Question
Explain the long Data Type with an Example.
Explain
Advertisements
Solution
The long data type is a primitive integer data type in Java that is used to store large whole numbers without decimal points. It is a 64-bit signed integer data type that occupies 8 bytes of memory. It can store values ranging from −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Example:
long population = 10000000000L;In the above example, long specifies the data type, population is the variable name, and 10000000000L is the integer value assigned to the variable. The suffix L indicates a long integer literal.
shaalaa.com
Is there an error in this question or solution?
