fork(5) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4.  
  5. public class Main {
  6. public static void main(String[] args) {
  7. System.out.println(shuffle("Boa noite"));
  8. }
  9.  
  10. public static String shuffle(String s) {
  11. List<String> letters = Arrays.asList(s.split(""));
  12. Collections.shuffle(letters);
  13. StringBuilder t = new StringBuilder(s.length());
  14. for (String k : letters) {
  15. t.append(k);
  16. }
  17. return t.toString();
  18. }
  19. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
oani etoB