public class ReverseString {
/**
* @param args
*/
public static void main(String[] args) {
//String[] name = new String[10];
String name , rev = "";
Scanner in = new Scanner(System.in);
System.out.println("Enter the string for reversal :- ");
name = in.nextLine();
int len = name.length();
for(int i = len-1;i>=0;i--){
rev = rev + name.charAt(i);
}
System.out.println(rev);
}
}
Explore the Latest in Tech & Automation: Android, iOS, Mobile Testing with Appium, Web Automation using Selenium, Python & Java Programming, Robot Framework, Shell & PowerShell Scripting, QA Tools, Spring Boot Development, Agentic AI Innovations, Free Software Resources, and Expert Tips on Designing Scalable Automation Frameworks.
Saturday, August 23, 2014
Java : Program to reversing a string
Subscribe to:
Post Comments (Atom)
Testing a New Product: Essential Information Software Testers Must Gather in the AI Era
Learn what information software testers must gather before starting testing a new product, including AI, automation, compatibility, and ...
-
How to change language of device using commandLine Changing language in Android device on-the fly is needed when we are running or exe...
-
How to find the UDID of Android Device What is UDID : It stands for Unique Device Identifier. UDID is required duri...
-
How to upgrade JAVA version in AWS Linux instance On AWS EC2 instance(Linux) if you ever want to upgrade JAVA version to latest ,you can...
No comments:
Post a Comment