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.
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback