To convert
String
to long
in Java, use Long.parseLong
.Here's how you do it:
String string = "1234";
long longFromString = Long.parseLong(string);
System.out.println(longFromString); // 1234
String
to long
in Java, use Long.parseLong
.Here's how you do it:
String string = "1234";
long longFromString = Long.parseLong(string);
System.out.println(longFromString); // 1234