<\/span><\/h2>\n\n\n\nYou are given an integer n<\/em><\/strong>, you have to convert it into a string.<\/p>\n\n\n\nPlease complete the partially completed code in the editor. If your code successfully converts n <\/em><\/strong>into a string s <\/em><\/strong>the code will print “Good job”. Otherwise it will print “Wrong answer”.<\/p>\n\n\n\nn <\/em><\/strong>can range between -100 <\/em><\/strong>to 100 <\/em><\/strong>inclusive.<\/p>\n\n\n\nSample Input <\/strong><\/p>\n\n\n\n 100<\/code><\/pre>\n\n\n\nSample Output <\/strong><\/p>\n\n\n\n Good job<\/code><\/pre>\n\n\n\n<\/span>Solution –<\/strong> Java Int to String<\/strong><\/span><\/h2>\n\n\n\nimport java.util.*;\nimport java.security.*;\npublic class Solution {\n public static void main(String[] args) {\n\n DoNotTerminate.forbidExit();\n\n try {\n Scanner in = new Scanner(System.in);\n int n = in .nextInt();\n in.close();\n \/\/String s=???; Complete this line below\n \/\/Write your code here\n\n String s = \"\" ; \n if(n>=-100 && n<=100)\n {\n s = Integer.toString(n);\n }\n\n if (n == Integer.parseInt(s)) {\n System.out.println(\"Good job\");\n } else {\n System.out.println(\"Wrong answer.\");\n }\n } catch (DoNotTerminate.ExitTrappedException e) {\n System.out.println(\"Unsuccessful Termination!!\");\n }\n }\n}\n\n\/\/The following class will prevent you from terminating the code using exit(0)!\nclass DoNotTerminate {\n\n public static class ExitTrappedException extends SecurityException {\n\n private static final long serialVersionUID = 1;\n }\n\n public static void forbidExit() {\n final SecurityManager securityManager = new SecurityManager() {\n @Override\n public void checkPermission(Permission permission) {\n if (permission.getName().contains(\"exitVM\")) {\n throw new ExitTrappedException();\n }\n }\n };\n System.setSecurityManager(securityManager);\n }\n}\n<\/pre>\n\n\n\n