Java Int to String

Sort by

recency

|

816 Discussions

|

  • + 0 comments

    import java.io.; import java.util.;

    public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
    
        int n = in.nextInt();
        String s = String.valueOf(n);
        System.out.println("Good job");
    
        in.close();
    }
    

    }

  • + 0 comments

    Java Logic

    String s = String.valueOf(n);

  • + 0 comments

    String s = String.valueOf(n);

  • + 0 comments

    String s = n +"";

  • + 1 comment

    String s=Integer.toString(n); just add this line and remove int s=sc.nextInt();