Java Examples

100+ tutorials, source code, and examples to help you develop creative and technical skills.

Reverse A String Using Array in Java

ReverseofaString.java

/* Code From Learnoset - Learn Code Online Android App.*/
/*Download Learnoset App from PlayStore to learn coding*/

import java.util.Scanner;

class ReverseofaString
{
	public static void main(String[ ] arg)
	{
	String str;
	Scanner scan=new Scanner(System.in);
	System.out.print("Enter a string : ");
	str=scan.nextLine();	
	char[] ch=str.toCharArray(); 
	System.out.println("Reverse of a String is :"); 
	int j=ch.length;
	for(int i=j;i>0;i--)
	{
	System.out.print(ch[i-1]); 
	}
	}
}

/*----------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.

Online-Quiz-Application-using-Firebase-Realtime-Database-Source-Code
Online Quiz Application using Firebase Realtime Database Source Code
Login-&-Register-Screen-UI-Design---01
Login & Register Screen UI Design - 01
Gamer-Bazi---Tournament-Application-with-Admob-Ads-&-Web-Admin-Panel
Gamer Bazi - Tournament Application with Admob Ads & Web Admin Panel

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.