The error message sums it up pretty well: str1 is a String, which does not have an append() method.