logo CodeStepByStep logo

dracula

Language/Type: Java string

What is the value of s after the following code is finished running?

String s = "dracula";
for (int i = 0; i < s.length(); i++) {
    char a = s.charAt(0);
    String b = s.substring(1);
    s = b + a;
}
value of s
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.