lundi 6 août 2018

Tried to make a variable that's a random number but got an error. Can anyone tell me what's wrong?

Now keep in mind that I am a beginner, who's just interested in making something cool. So, in a project I'm making, it needed a variable with a random integer value from 1-3. I researched and wrote this:

    @Override
    Random rand = new Random();
    n = rand.nextInt(3) + 1;
    public int quantityDropped(Random par1Random) {
        return n;
    }

So it said my code had errors and it didn't specify. I know that its probably really obvious but I'm confused and really want to continue coding with more projects.




Aucun commentaire:

Enregistrer un commentaire