Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by Julio Tentor <jtentor@fi.unju.edu.ar>
- //
- 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());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement