Constructors from Long
Long(long value)
- Creates a Long object that represents the specified long argument.
Long(String s)
- Creates a Long object that represents the long value indicated by the String parameter.
public class Main {
public static void main(String[] args) {
Long long1 = new Long(12345L);
Long long2 = new Long("12346");
System.out.println(long1);
System.out.println(long2);
}
}
The output:
12345
12346
Home
Java Book
Essential Classes
Java Book
Essential Classes
Long:
- Long class
- Constants value from Long class
- Constructors from Long
- Convert long value to byte, double, float, int, long, short
- Decode a string to create long value
- Get the long value from a system property
- Compare two long values
- Parse long value from string
- Convert long value to binary, hex and octal format strings
- Convert long value to string
- Get the sign of the long value
- Get the number of zero bits preceding and following
- Reverse and rotate a long value