We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java Int to String
- Discussions
Java Int to String
Java Int to String
Sort by
recency
|
802 Discussions
|
Please Login in order to post a comment
**Only one line code **
i am totally confused. because of i am writing again and again if condition unnecessary. after i realised what kind of mistake doing again nd again. only i have to write one line code.
String s=Integer.toString(n);
that's all set.
Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = Integer.toString(n);
String s = n+"";
//second way String s2 = String.valueOf(n);
//third way String s3 = Integer.toString(n);
import java.io.; import java.util.;
public class Solution {
}