Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public char[] generarCodigo() {
  2. char[] abecedario = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
  3. 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
  4. 'X', 'Y','Z'};
  5. char[] codigo = new char[4];
  6. for (int i = 0; i <4; i++) {
  7. int escogido = (int) (Math.random() * 25);
  8. codigo[i] = abecedario[escogido];
  9. }
  10. return codigo;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement