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
Explain about exception propagation?
When the constructor of a class is invoked?
What is a singleton in genetics?
How will you add panel to a frame?
Explain thread life cycle in java?
How is the marker interface used in Java?
What are multiple inheritances?
What is method overriding in java ?
Can you instantiate the math class in Java?
What are the files generated after using IDL to java compiler?
What is string english?
Can a method be overloaded based on different return type but same argument type?
Is binary a low level language?
What is java jit compilers?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?