//
program to reverse the order of a string by Hing Tze
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Application1
{
public Application1()
{
String s1 = ("abcdefghij");
// Sample string
String s2="";
int counter;
// loop counter
int leng = s1.length() - 1; // length() method for length
of a string
char c;
// char variable
for (counter=leng;
counter>=0; counter = counter - 1)
{
c = s1.charAt(counter);
s2 = s2 + c;
}
JOptionPane.showMessageDialog(null,"New string is: " + s2);
System.exit(0);
}
}