Limited access

Consider the following code segment.

 String name = "Amanda";
String next = "";
for (int j = 1; j <= name.length(); j++)
{
next += "" + name.substring(name.length() - j, name.length() - j + 1);
}
System.out.println(next);


What is printed as a result of executing the code segment?

A

Amanda

B

mand

C

manda

D