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