We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I agree, the 3rd solution is probably less efficient because it has to do an unnecessary concatenation (+). I also like solution 1 and 2 better since it's clearer what the code accomplishes.
Java Int to String
You are viewing a single comment's thread. Return to all comments →
I agree, the 3rd solution is probably less efficient because it has to do an unnecessary concatenation (+). I also like solution 1 and 2 better since it's clearer what the code accomplishes.
HackerRank solutions.
Doesn't String.valueOf() call Integer.toString in it's implementation?
public static String valueOf(int i) { return Integer.toString(i); }
i want full discussion