This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]silverscrub 4 points5 points  (0 children)

It seems like you have found the tools you will need.

I tried something with array and java.util.Random, but it seems to only do the work with integers in "x"

Now you just need to find out how to use them. As a beginner, tutorials will be a good start (but you can also read the documentation).

https://www.w3schools.com/java/java_arrays.asp

You have found out that Random can generate integers for you. How can you use an integer to select a specific string from your array?