can you program for reverse string?

Answer Posted / suresh

class suresh
{
public static void main(String args[])
{
String s="sureshreddy";
for(i=s.length()-1;i>=0;i--)
{
System.out.println(s.charAt(i));
System.out.println(s.length());//it wil print the length
}
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an example of declaration?

780


What is an example of a keyword?

783


How to make a class or a bean serializable?

755


Can you declare a private method as static?

936


Why static functions are used?

831


What is classname class in java?

782


what is deadlock? : Java thread

762


Why java is platform independent? Explain.

807


What does the string method compareto () do?

792


Is it compulsory for a try block to be followed by a catch block in java for exception handling?

809


Can you have two constructors in java?

717


What is supplier in java?

806


What do you mean by global variable?

734


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

730


Can we use this () and super () in a method?

759