Java Int to String

  • + 0 comments
    public class Solution {
    
        public static void main(String[] args) {
            int I;
            String converted;
            Scanner scan = new Scanner(System.in);
            I = scan.nextInt();
    				
    				
            try 
            {
                if (I<=100 && I>=-100) {
                    converted = String.valueOf(I);
                    System.out.println("Good job");
                }
            } catch(Exception e) {
                System.out.println("Wrong answer");
            }
            
        }
    }