How to convert String to a Long object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
  
        String s = "3000000";
        Long l = Long.valueOf(s);
        System.out.println(l);
    }
}
 
/*
    
run:
    
3000000

*/

 



answered Nov 3, 2016 by avibootz

Related questions

1 answer 128 views
1 answer 147 views
4 answers 330 views
330 views asked Nov 8, 2016 by avibootz
2 answers 147 views
147 views asked Jun 17, 2021 by avibootz
2 answers 165 views
165 views asked Jun 17, 2021 by avibootz
...