This repository contains simple Java programs demonstrating string manipulation techniques such as reversing a string with and without preserving spaces. These examples are great for practicing Java fundamentals and interview preparation.
Reverses a string normally, without using the built-in reverse() method.
Example: Input: I miss you Output: uoy ssim I
Reverses a string while keeping the spaces in their original positions.
Example: Input: I am QA Tester Output: r etseT AQ ma I
- Open any IDE (Eclipse, IntelliJ, VS Code) or terminal.
- Navigate to your project directory: cd src/com/javapractice Compile the program:
javac ReverseString.java Run it: java ReverseString or for the second one: java ReverseStringPreserveSpaces
π¨βπ» Author Siam Hossain (SiamBytes) π Based in New York, USA πΌ Java | QA | SDET | Automation Enthusiast π GitHub Profile
β Support If you like this project, please β the repo β it motivates me to share more Java practice examples!