its very simple
1) what does this result in
System.out.print(str.substring(0,3));
It will result in Hel since starting point is 0 and count upto 3 characters(remember the first element in indexed 1)
2)System.out.println(str.replace('r', 'h'));
after this is executed there is no match and the same
string is retturned
so it is Hello refer to API for more details.
-A