like this :
Sample run:
Please enter a number: 1234567
The shuffled number is: 4356271
Sample run:
Please enter a number: 1000001
The shuffled number is: 0100100
like this :
Sample run:
Please enter a number: 1234567
The shuffled number is: 4356271
Sample run:
Please enter a number: 1000001
The shuffled number is: 0100100
Converting the number in a String use this method passing the string to it!
public void shuffle(String input){
List<Character> characters = new ArrayList<Character>();
for(char c:input.toCharArray()){
characters.add(c);
}
StringBuilder output = new StringBuilder(input.length());
while(characters.size()!=0){
int randPicker = (int)(Math.random()*characters.size());
output.append(characters.remove(randPicker));
}
System.out.println(output.toString());
}