Reverse A String Using while loop in Java
Reverse.java
/* Code From Learnoset - Learn Code Online Android App.*/
/*Download Learnoset App from PlayStore to learn coding*/
import java.util.Scanner;
class Reverse
{
public static void main(String[ ] arg)
{
String str;
Scanner scan=new Scanner(System.in);
System.out.print("Enter a string : ");
str=scan.nextLine();
System.out.println("Reverse of a String '"+str+"' is :");
int i=str.length();
while(i>0)
{
System.out.print(str.charAt(i-1));
i--;
}
}
}
/*----------OUTPUT-------------*/
/*Enter a string : Learnoset
Reverse of a String is : tesonraeL*/
Projects with Source Code + Video Tutorials
You can download our Java and Android Studio Projects with Source Code and Video Tutorials.

Programming Quiz App for Android (Offline Version)

Spin and Win App for Android (Offline Version)

How to create Modern Login and Register screen in Android Studio | Material UI Design | Part - 06
If you have any Questions or Queries
You can mail us at info.learnoset@gmail.com
Follow us to learn Coding and get in touch with new Technologies.