I\'d like to add a method AddDefaultNamespace() to the String class in Java so that I can type \"myString\".AddDefaultNamespace() instead of
AddDefaultNamespace()
\"myString\".AddDefaultNamespace()
Better use StringBuilder, which has method append() and does the job you want. The String class is final and can not be extended.