MCQs > IT & Programming > Core Java > What is the issue with the following code? String s = ""; for(int i = 0; i < 1000000; i++) { s += Integer.toString(i); }

Core Java MCQs

What is the issue with the following code? String s = ""; for(int i = 0; i < 1000000; i++) { s += Integer.toString(i); }

Answer

Correct Answer: It will perform very slowly because strings are immutable.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Core Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Core Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it