Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 votes

For some reason under the rollDie method of part A, randGen is always showing an error. I have imported both java.util.* and java.util.Random. Can someone help me if they ran into the same problem or know what might be wrong?

asked in CSC305 Fall 2022 by (240 points)
reshown by
+4

Do you think you can provide a code sample of the pertinent line that's giving an error? The error message itself would also be appreciated.

2 Answers

+2 votes

Actually nvm I solved it I wasnt creatinf instance of my random class haha

answered by (240 points)
+2 votes

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(); ?

answered by (451 points)
...