unexpected type error

The problem is here:
[java]myStr.charAt(j) += reversed;[/java]
The left-hand-side is a value. Not a variable. That’s why you can’t to a += to it.

Although it defeats the purpose of learning how do it the hard way, you can do it like this:

[java]myStr = new StringBuffer(myStr).reverse().toString();[/java]

Leave a Comment