Java Long parseLong Example
Long class parseLong method example.
Long class parseLong method example. This example shows you how to use parseLong method. This method parses or converts the String value to specified datatype value
Syntax:- parseLong(String s)
Here is the code:-
/**
* @(#) ParseLongLong.java
* ParseLongLong class demonstrates the working of parseLong()method of Long class of lang package
* @version 9-May-2008
* @author Rose India Team
*/
public class ParseLongLong {
public static void main(String args[]) {
String don = "43858754";
String donkey = "55.354";
// here the method parses or just convert the String represented value
// into specified datatype value
long hero = Long.parseLong(don);
double out = Double.parseDouble(donkey);
System.out.println(" parsed Integer value is " + hero
+ " and parsed Double decimal value is " + out);
}
} |
null
|