lundi 16 décembre 2019

Java: Generator a random value then add 1 to the value in another variable

I know smilar questions have been asked about this, however non of the ones i have seen so far seems to help me in the way i need it to.

My Goal

I want to be able to add 1 to the random value i get.

Query query = FirebaseDatabase.getInstance().getReference("Level").orderByKey().startAt(String.valueOf(rand)).endAt(String.valueOf(rand));

the endAt need to be +1 of the rand value

if i do rand +1 I get the error: Operator '+' cannot be applied to Java.Random

Anyone have any tips for me?




Aucun commentaire:

Enregistrer un commentaire