Java
- 4 ответа
- 0 вопросов
2
Вклад в тег
String[] shops = { "DE", "CH", "AT", "NL", "FR", "DK", "ES", "IT", "EN", "SE", "NO", "FI", "PT", "BE", "LU",
"RO", "GR", "CZ", "PL", "HU" };
List<String> list = new ArrayList<String>(Arrays.asList(shops));
StringBuilder builder = new StringBuilder();
int count =0;
while (count < 5) {
Random r = new Random();
int rand = r.nextInt(list.size());
builder.append(list.get(rand)).append(" ");
list.remove(rand);
count++;
}
String shopsForTest = builder.toString();
System.out.println(shopsForTest);