What will be printed out after the following code is compiled and executed?

String d = "beekeeper";
d.substring(1,7);
d = "w" + d;
d.insert(3, "bee");
System.out.println(d);
Explanation
The String class is immutable and doesn't contain an insert() method
StringBuffer and StringBuilder classes significantly differ from String class - their content may be modified by append, insert and delete methods.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback