Package libtarea2

Class Utilidades


  • public class Utilidades
    extends java.lang.Object
    Clase Utilidades. Caja de herramientas.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generaPin()
      Genera un PIN de seis dígitos aleatorios
      static int numAleatorio​(int min, int max)
      Genera un número entero aleatorio entre un valor mínimo y un valor máximo, ambos incluidos.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • numAleatorio

        public static int numAleatorio​(int min,
                                       int max)
        Genera un número entero aleatorio entre un valor mínimo y un valor máximo, ambos incluidos.
        Parameters:
        min - mínimo valor posible
        max - máximo valor posible
        Returns:
        número aleatorio entre min y max
      • generaPin

        public static java.lang.String generaPin()
        Genera un PIN de seis dígitos aleatorios
        Returns:
        PIN aleatorio de seis dígitos