Constructors from Long

ConstructorSummary
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
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.