Answer Posted / milind s
Most of time in interview asked without using Build Function**
public String reverse(String arg)
{
String tmp = null;
if (arg.length() == 1)
{
return arg;
}
else
{
String lastChar = arg.substring(arg.length() - 1,
arg.length());
String remainingString = arg.substring(0,
arg.length() - 1);
tmp = lastChar + reverse(remainingString);
return tmp;
}
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
When parseint method can be used?
What is function and its uses?
What is method in java with example?
Why collection doesn’t extend cloneable and serializable interfaces?
why Java does not support multiple inheritances?
Why we cannot override static method?
Is array a class in java?
What an i/o filter in java programming?
What is ‘has a’’ relationship in java?
Why destructor is not used in java?
What is meant by attribute?
What is the difference between final, finally and finalize()?
What is the advantage of functional interface in java 8?
What is a pattern what is an anti pattern?
Does string isempty check for null?