Hello All!
I am working on a StringBuffer program and I am getting the following error message:
Cannot find symbol - method append(java.lang.String) with this part of the code selected:
return str1.append(str9);
I am not sure how to fix this. Any help would be greatly appreciated! I am posting the entire code below. Thank you!
import java.util.*; import java.lang.StringBuffer; class stringBuffProject { static String append(String str1, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9) { return str1.append(str9); } public static void main(String[] args) { List<String> projectStringBuffers = new ArrayList<String>(); projectStringBuffers.add("The "); projectStringBuffers.add("quick "); projectStringBuffers.add("brown "); projectStringBuffers.add("fox "); projectStringBuffers.add("jumped "); projectStringBuffers.add("over "); projectStringBuffers.add("the "); projectStringBuffers.add("lazy "); projectStringBuffers.add("dog."); System.out.println(projectStringBuffers.get(0).append(projectStringBuffers.get(1)).append(projectStringBuffers.get(2)).append(projectStringBuffers.get(3)).append(projectStringBuffers.get(4)).append(projectStringBuffers.get(5)).append(projectStringBuffers.get(6)).append(projectStringBuffers.get(7)).append(projectStringBuffers.get(8))); } }