| Author |
Create string in random order.
|
Shirley Flood
Greenhorn
Joined: Mar 25, 2008
Posts: 4
|
|
String text = "Work at Home"; I need to write the code that will create a new string the same length, and contain each character of the original string in random order. class Stringrandom { public static void main(String[] arguments) { String str = "Work at Home"; System.out.println("The random string is: " + str.random()); } } [ March 27, 2008: Message edited by: Shirley Flood ]
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10043
|
|
First, welcome to the Ranch!!! Second, we're happy to help. But you need to show us what you've done, and tell us where you're stuck. We can point you in a direction, but you're gonna have to do most of the work yourself.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
Pesudo code: Now for some hints: - use StringBuilder (Java 5 or up) or StringBuffer (Java 1.4 and down) for random and orig - use java.util.Random for getting the random index
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Create string in random order.
|
|
|