Convert String to long - Java Language Basics

Java examples for Language Basics:String

Description

Convert String to long

Demo Code


public class Main {
 
  public static void main(String[] args) {
    //declare String object
    String str = new String("10");
    long l = Long.parseLong(str);
    System.out.println(l);//from  w w w. ja v a 2s. c  o  m
  }
}

Result


Related Tutorials