Deprecated Garbage Collections – Kenny Lee Chee Wei

A truckload of garbage by Kenny Lee Chee Wei

Archive for the ‘Performance’ Category


leave a comment »

  1. String s = "f" + "o" + "o"
  2. is faster than

    String s = "f";

  3. The comparison
    ('a' == s.charAt(0))
  4. is faster than


  5. The StringBuffer default capacity is 16. If your string is going to be larger than that, you might as well reserve a larger capacity by passing a realistic length such asStringBuffer sb = new StringBuffer(1024);

Written by kennii

August 9, 2007 at 5:02 pm

Posted in Performance