I've been going through the StringBuffer part of my unit and believe that I have gained enough understanding to manipulate the StringBuffer in a program. Yet each time I try to invoke one of the methods outlined in the unit, I'm given an error message. Is there something wrong with my syntax or logic? Is there something that I need to import? Any help would be appreciated. I am attaching my output below. Thank you all so much!
public class StringBuffer
{
public static void main(String[] args)
{
StringBuffer sbuff = new StringBuffer();
//one attempt to append - error
sbuff.append("Jenna");
//second attempt to append - error
String phrase = new String("Jenna");
sbuff.append(phrase);
//attempts to call upon other methods - errors
System.out.println("Your name backwards is: " + sbuff.reverse());
System.out.println("The length of your name is: " + sbuff.length());
}
}