51. String and String builder, which is faster?

String and String builder, which is faster?

  • String Builder is faster because it changes the value of its own object
  •  String is immutable and when we manipulate with String object, we create another String object and change the copied object
    —> String is slower than String Builder

Leave a Reply

Your email address will not be published. Required fields are marked *