Java Int to String

Sort by

recency

|

770 Discussions

|

  • + 0 comments
    import java.io.*;
    import java.util.*;
    public class Solution {
        public static void main(String[] args) {
                System.out.println("Good job");
            
        }
    }
    
  • + 0 comments

    yo lo hice de la siguiente manera try { Scanner in = new Scanner(System.in); int n = in.nextInt(); in.close();

            Integer num = n;
            String s = num.toString();
    
            if (n == Integer.parseInt(s)) {
                System.out.println("Good job");
            } else {
                System.out.println("Wrong answer.");
            }
        } catch (DoNotTerminate.ExitTrappedException e) {
    
            System.out.println("Unsuccessful Termination!!");
        }
    
  • + 0 comments

    String s = Integer.toString(n);

  • + 0 comments

    import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in .nextInt(); String s =Integer.toString(n); if (n == Integer.parseInt(s)) { System.out.println("Good job"); } else{ System.out.println("Wrong answer."); } } }

  • + 0 comments

    String s = n+"";