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
What does this () mean in constructor chaining concept?
what is encapsulation in java? Explain
What is protected access modifier?
What are thread priorities and importance of thread priorities in java?
What are the new features in java 8?
Can inner class be public in java?
Is string serializable in java?
What is unicode datatype?
Explain enumeration in java?
Are arrays immutable in java?
What is class and its types?
What is the difference between abstract classes and interfaces?
Can we initialize the final blank variable?
Where are variables stored?
How is abstraction implemented in java ?