The long keyword

long is a keyword in java that is used to store 64-bit
integer (Java primitive type) value. Keywords
are basically reserved words which have specific meaning relevant to a compiler.
The keyword long in java is also used to declare an expression, method
return value, or variable of type long integer.
The Long class in java programming language wraps a long
type primitive value in an object. An Long type object includes only a single
field whose type is long. Wrapper class is used to convert the long
primitive values into Long type objects. In addition to this Long wrapper class
also provides methods for converting a long to String and vice versa as well as
other constants and methods that are useful to deal with long type.
Syntex: Here is the syntax that displays
how to declare and define a long type variable.
Here are some more examples.
|
long anotherNumber = 34590L;
long octalNumber = 0377;
long hexNumber = 0xffl; |
Note: Here are some points that must consider
in case of long data type.

|