Hackerrank Java Int to String Solution

Hackerrank Java Int to String Solution

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);