and why? the string class in c++ is not immutable but in java it is, my lecturer said he prefers immutable strings, is there any reason that immutable strings are better?
Well that depends on what you're trying to accomplish. To make a string immutable in C++ you declare it as a const. const string name;. If you need to be able to change the string object in the future, then obviously you would not want to make it immutable. But if you don't need to change it, then const, is appropriate.
my lecturer said he prefers immutable strings
How could he prefer immutable strings? It depends on the need.