Hello
We have been studying Strings and I don't understand the following line:
System.out.print1n(''Length of the String is : "+str1. length());
Shouldn't "str1" be "strbuf"?
I have copied the code in full below. Thank you in advance for any help!
public class StringBufferAssign { public static void main(String[] args) { StringBuffer strbuf = new StringBuffer(); strbuf.append("Houghton Mifflin")'; int len=str1.length(); int vcount=0; strbuf.reverse(); System.out.print1n("The Reverse of the string is:"strbuf); for(int i=1en=1; i>=0; i==) { System.out.print(strbuf.charAt(i)); if((strbuf.charAt(i)=='a')||(strbuf.charAt(i)=='e' ) ||(strbuf.charAt(i)=='1')||(strbuf.charAt(i)=='o')||(strbuf.charAt(i)='u')) { vcount++; } } System.out.print1n(''Length of the String is : "+str1. length()); System.out.print1n("Number of vowels in the string is : "+ vcount): } }