You've successfully subscribed to The Poor Coder | Hackerrank Solutions
Great! Next, complete checkout for full access to The Poor Coder | Hackerrank Solutions
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Hackerrank Java Int to String Solution

Hackerrank Java Int to String Solution

Beeze Aal
Beeze Aal

You are given an integer , you have to convert it into a string.

Please complete the partially completed code in the editor. If your code successfully converts  into a string  the code will print "Good job". Otherwise it will print "Wrong answer".

can range between  to  inclusive.

Sample Input 0100

Sample Output 0.MathJax_SVG_LineBox {display: table!important} .MathJax_SVG_LineBox span {display: table-cell!important; width: 10000em!important; min-width: 0; max-width: none; padding: 0; border: 0; margin: 0} Good job

Solution in java8

Approach 1.

   String s = ""+n;

Approach 2.

   String s = n+"";
   

Approach 3.

   String s = String.valueOf(n);