String Reverse in Java...!

Answer Posted / soumya roy

public class rev
{

public static void main(String[] args)
{
String str="hi my name is hello ";
System.out.println("the string is :" + str);
char[] ch=str.toCharArray();
int i;
int len = ch.length;
for(i=len-1;i>=0;i--)
{
System.out.print(ch[i]);
}
}
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a method in programming?

634


Is nullpointerexception checked or unchecked?

553


What is difference between classpath and path variables in java?

554


What is the independent variable in an experiment?

546


Can we override singleton class?

535






Define nashorn in java8.

566


How many ways can you break a singleton class in java?

487


What is qms certification?

521


What is the use of optional ?

567


Are generics important java?

522


Explain how can you debug the Java code?

588


Explain naming conventions for packages?

576


What is visibility mode?

529


What is the benefit of inner / nested classes ?

526


What are the elements of java?

561