jtentor icon

Demo Date 1

jtentor | PRO | 09/14/21 12:19:31 AM UTC | 0 ⭐ | 1827 👁️ | Never ⏰ | []
Java |

680 B

|

None

|

0 👍

/

0 👎

//
// Created by Julio Tentor <[email protected]>
//
 
import java.util.Date;
import java.util.Random;
 
public class Program {
    // hace falta para generar números aleatorios
    static Random random = new Random();
 
    public static void main(String[] args) {
 
        Integer dia;
        Integer mes;
        Integer anio;
        Date fecha1;
 
        Integer count = 5;
        while (count-- > 0) {
            dia = random.nextInt(28) + 1;
            mes = random.nextInt(12) + 1;
            anio = random.nextInt(100);
            fecha1 = new Date(anio, mes, dia);
            System.out.println("Fecha " + fecha1.toString());
        }
    }
}
 

Comments