Java Data Type Tutorial - Java Long.getLong(String nm)








Syntax

Long.getLong(String nm) has the following syntax.

public static Long getLong(String nm)

Example

In the following code shows how to use Long.getLong(String nm) method.

/*  www.  j  ava2  s .  co m*/
public class Main {

   public static void main(String[] args) {

     
     System.setProperty("Java2s.com", "12345");
     String str = "Java2s.com";
     System.out.println(Long.getLong(str));

   }
}

The code above generates the following result.