Created
May 24, 2013 10:17
-
-
Save keokent/5642580 to your computer and use it in GitHub Desktop.
教えていただいたSekigae.javaの改良版!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collections; | |
import org.apache.commons.lang3.StringUtils; | |
import org.apache.commons.lang3.time.DateUtils; | |
public class Sekigae{ | |
public static void main(String[] args){ | |
ArrayList<String> list = new ArrayList<String>(); | |
list.add("okkun"); | |
list.add("kitak"); | |
list.add("keoken"); | |
list.add("gussun"); | |
Collections.shuffle(list); | |
String result = StringUtils.join(list.toArray(), ","); | |
System.out.println(result); | |
// System.out.println(StringUtils.join(list, " | ")); | |
// System.out.println(list.get(0) +" | "+ list.get(1) +" | "+ | |
// list.get(2) +" | "+ list.get(3)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment