Example usage for java.lang Long Long

List of usage examples for java.lang Long Long

Introduction

In this page you can find the example usage for java.lang Long Long.

Prototype

@Deprecated(since = "9")
public Long(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Long object that represents the long value indicated by the String parameter.

Usage

From source file:Main.java

public static void main(String[] args) {
    Long long1 = new Long(12345L);

    System.out.println(long1);
}

From source file:Main.java

public static void main(String[] args) {
    Long long2 = new Long("12346");

    System.out.println(long2);
}

From source file:Main.java

public static void main(String[] args) {
    Long long1 = new Long(12345L);
    Long long2 = new Long("12346");

    System.out.println(long1.equals(long2));
}

From source file:Main.java

public static void main(String[] args) {
    Long long1 = new Long(12345L);
    Long long2 = new Long("12346");

    System.out.println(long1.compareTo(long2));
}

From source file:Main.java

public static void main(String[] args) {

    Long l = new Long(1234567890);

    int retval = l.hashCode();
    System.out.println("Value = " + retval);
}

From source file:Main.java

public static void main(String[] args) {

    Long l = new Long(1234567890);

    // returns a string representation of the long value in base 10
    String retval = l.toString();
    System.out.println("Value = " + retval);
}

From source file:Main.java

public static void main(String[] args) {
    Long lObj1 = new Long("100");
    System.out.println(lObj1);//from  ww w  .  j  av a 2 s  .c  om

    String str = "100";
    Long lObj2 = Long.valueOf(str);
    System.out.println(lObj2);
}

From source file:Main.java

public static void main(String[] args) {
    Long longObject = new Long("1234567");
    double d = longObject.doubleValue();
    System.out.println("double:" + d);

}

From source file:Main.java

public static void main(String[] args) {
    Long longObject = new Long("1234567");
    int i = longObject.intValue();
    System.out.println("int:" + i);

}

From source file:Main.java

public static void main(String[] args) {
    Long longObject = new Long("1234567");
    byte b = longObject.byteValue();
    System.out.println("byte:" + b);

}