The only error in your code is for str2. If you remove the "new" keyword the code will compile and run.