Question 1 of 10
A bakery reprints icing codes from the last letter backward. What text does this Java code display?
public static String peel(String s)
{
if (s.length() <= 1)
{
return s;
}
return s.substring(s.length() - 1) + peel(s.substring(0, s.length() - 1));
}
System.out.print(peel("cake"));
- A. cake
- B. acek
- C. ekac
- D. ecak