Convert a long to string in Java

Convert a long to string in Java

In this post we will give you information about Convert a long to string in Java. Hear we will give you detail about Convert a long to string in JavaAnd how to use it also give you demo for it if it is necessary.

To convert a long to string, we can use the Long.toString() method in Java.

Here is an example:

long number = 123345678911L;String str = Long.toString(number);System.out.println(str);

Output:

12345678911

You can also use the String.valueOf() method to convert a long to string.

long number = 123345678911L;String str = String.tovalueOf(number);System.out.println(str);  // 12345678911

Hope this code and post will helped you for implement Convert a long to string in Java. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US