Given a string and we have to convert it into a long.
Java conversion from String to Long
To convert a String to Long, we can use the following methods of Long class (see the syntax given below...)
Syntax:
Long Long.valueOf(String).longValue();
OR
Long Long.parseLong(String);
Java code to convert a String to Long
Output