can you program for reverse string?

Answer Posted / raj

public static void main (String args[])
{ String s1="1234567";

for(int i=s1.length()-1;i>=0;i--)
{
System.out.print(s1.charAt(i));
}
}

Is This Answer Correct ?    25 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to obtain a performance profile of java program

547


Is an array a vector?

558


What data type is a string?

515


How many types of methods are there?

552


Can a java program have 2 main methods?

554






How to change value in arraylist java?

507


Explain the difference between abstract classes and interfaces in java?

602


what do you mean by stream pipelining in java 8? Explain

542


Why is singleton class used?

529


Describe the term diamond problem.

579


What is difference between Heap and Stack Memory?

540


What is the use of using enum to declare a constant?

562


What is t in generics in java?

565


What is the main functionality of the remote reference layer?

1420


Can we clone singleton class in java?

521