vendredi 13 février 2015

selecting a random char in a string in java with a certain method

I have to select and return 1 random character out of a string using this method (separate from main method):


public static char selectAChar(String s)


I'm not sure how to select the random variable, and not sure if i should use a for loop. everything I've tried I couldn't get it to return the right variable type.





Aucun commentaire:

Enregistrer un commentaire