Lesson 23 of 34
StringBuilder: Strings तेज़ी से बनाना
8 min 30 XP
Strings immutable हैं, इसलिए loop में += हर बार नई String बनाता है, जो धीमा है। StringBuilder mutable और तेज़ है। String बनाम StringBuilder interview का आम सवाल है।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.split() एक String को String array में तोड़ता है और String.join() टुकड़ों को फिर जोड़ता है।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.