Pregunta de entrevista de Intel Corporation

Write a recursive Java function to reverse a String object

Respuesta de la entrevista

Anónimo

18 jul 2015

public String reverse(){ if ( (str==null) || str.length()<=1) ){ return str; } return reverse(str.substring(1))+str.chatAt(0); }

6