can you program for reverse string?

Answer Posted / pratyush kumar nayak

String Original,Reverse="";
System.out.println("Enter String To Reverse");
Scanner sc=new Scanner(System.in);
Original=sc.nextLine();
int length=Original.length();
for(int i=length-1;i>=0;i--){
Reverse=Reverse+Original.charAt(i);
}
System.out.println("The Reversed String is " + Reverse);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is this keyword in java?

669


How many types of string data types are there?

636


what are synchronized methods and synchronized statements? : Java thread

660


What does jre stand for?

709


Does java return by reference?

632






What is the difference between serial and throughput garbage collector?

667


Is minecraft java edition free?

691


What causes memory leaks in java?

564


What does sizeof return?

638


Name few java util classes introduced with java 8 ?

605


What are triggers in DB? Explain their types. How do they work?

718


How to create a thread in java?

693


Why local variables are stored in stack?

588


For class CFoo { }; what default methods will the compiler generate for you>?

704


How can we make sure main() is the last thread to finish in java program?

779