Java String to longWe can convert String to long in java using Long.parseLong() method. ScenarioIt is generally used if we have to perform mathematical operations on the string that contains long number. Whenever we get data from textfield or textarea, entered data is received as a string. If entered data is long, we need to convert string to long. To do so, we use Long.parseLong() method. SignatureThe parseLong() is the static method of Long class. The signature of parseLong() method is given below: Java String to long ExampleLet's see the simple code to convert string to long in java. Let's see the simple example of converting String to long in java. Test it NowOutput: 9990449935 Next TopicJava long to String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India