Pro tip: In Eclipse, if you hover the mouse over the code that’s got the red underline (or if you hover it over the red x on the left side), it will give you a tip as to why it isn’t working.
It’s hard to answer this without knowing what the error is or seeing the code, but have you actually created a Random object i.e. Random example = new Random();
?