Java long to StringWe can convert long to String in java using String.valueOf() and Long.toString() methods. ScenarioIt is generally used if we have to display long number in textfield in GUI application because everything is displayed as a string in form. 1) String.valueOf()The String.valueOf() is an overloaded method. It can be used to convert long to String. The valueOf() is the static method of String class. The signature of valueOf() method is given below: Java long to String Example using String.valueOf()Let's see the simple code to convert long to String in java. Let's see the simple example of converting long to String in java. Test it NowOutput: 9993939399 2) Long.toString()The Long.toString() method converts long to String. The toString() is the static method of Long class. The signature of toString() method is given below: Java long to String Example using Long.toString()Let's see the simple code to convert long to String in java using Long.toString() method. Let's see the simple example of converting long to String in java. Test it NowOutput: 9993939399 Next TopicJava String to float |
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