10
String objects are immutable, but variables can be reassigned.
You created separate objects
a
ab
abc
abcd
abcde
Each of these immutable strings was assigned, in turn, to the variable str.
You can not change the contents (characters inside) a string.
Changing the variable is a different thing altogether.