I have the code below and all I want is to create a random binary string of fixed length (eg 4 bits).
public String Random(){ Random rg = new Random(); int n = rg.nextInt(); return Integer.toBinaryString(n); }
Aucun commentaire:
Enregistrer un commentaire