Results 1 to 2 of 2
Thread: how to make abcxyz to zyxcba
- 08-01-2007, 05:10 PM #1
Member
- Join Date
- Aug 2007
- Posts
- 1
- Rep Power
- 0
how to make abcxyz to zyxcba
I can get the result but I've to click manually to get it.. :confused:import javax.swing.JOptionPane;
import java.util.Scanner;
public class Change{
public static void main (String[]args){
String Input = JOptionPane.showInputDialog("Enter Word: ");
for(int i=0; i<Input.length()-1; i++)
JOptionPane.showMessageDialog(null,("The Results Is : " + i ));
}
}
- 08-01-2007, 07:21 PM #2
Member
- Join Date
- Aug 2007
- Posts
- 15
- Rep Power
- 0
Let me see if i've got your question right. You have one string and you just want to flip it over.
public class StringFlip
{
public static void main(String Args[])
{
String a="abcde";
String b="";
for(int x=a.length();x>0; x--)
{
b=b+a.substring(x-1,x);
}
System.out.println(b);
}
}
Tell me if this is what you are looking for.
Similar Threads
-
How to make a modal JFrame?
By surot in forum New To JavaReplies: 20Last Post: 06-11-2011, 11:31 PM -
i need help to make this program
By masaka in forum New To JavaReplies: 2Last Post: 03-23-2008, 01:26 PM -
Can't make JTable work -- please help!!
By cagalli83 in forum Advanced JavaReplies: 0Last Post: 02-13-2008, 09:31 AM -
How to make popups like in eclipse
By ekadosh in forum SWT / JFaceReplies: 0Last Post: 02-04-2008, 07:58 AM -
can i make a login form?
By mitsakos in forum New To JavaReplies: 2Last Post: 12-19-2007, 10:14 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks