Java Random Int getRandomInterests()

Here you can find the source of getRandomInterests()

Description

get Random Interests

License

Open Source License

Declaration

private static String[] getRandomInterests() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class Main {
    private static final Random r = new Random(System.currentTimeMillis());

    /**/*from  w  w w .j a v a 2 s  .  c o  m*/
     * @return
     */
    private static String[] getRandomInterests() {
        final String[] interests = { "bioinformatics", "web development", "semantic web", "requiremens analysis",
                "system modeling", "project planning", "project management", "software engineering",
                "software development", "technical writing" };
        Set<String> finalInterests = new HashSet<String>();
        for (int i = 0; i < 3; i++) {
            finalInterests.add(interests[r.nextInt(interests.length)]);
        }
        return finalInterests.toArray(new String[0]);
    }
}

Related

  1. getRandomInteger(int aStart, int aEnd)
  2. getRandomInteger(int min, int max)
  3. getRandomIntegerArray(Random rand, int size, int range)
  4. getRandomIntegerInRange(Random p_76136_0_, int p_76136_1_, int p_76136_2_)
  5. getRandomIntegerInRange(Random random, int i, int j)
  6. getRandomIntFromRange(int min, int max)
  7. getRandomInts(int number)
  8. getRandomIntStr(int len)
  9. rand(int min, int max)