Create a Long object in Java
Description
The following code shows how to create a Long object.
Example
/* w w w . j a va 2 s . c o m*/
public class Main {
public static void main(String[] args) {
long l = 10;
Long longObj1 = new Long(l);
Long longObj2 = new Long("5");
System.out.println(longObj1);
System.out.println(longObj2);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »