Advertisement
FacuValverdi

MDPYPC-TP03-Punto 3.- Actualizando Fechas

Apr 5th, 2020
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package punto3;
  2. import java.util.Calendar;
  3. public class Fecha {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         Calendar calendario = Calendar.getInstance();
  8.         String[] Dias = new String[]{"Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado"};
  9.         for(int i=0;i<=100;i++) {
  10.              System.out.println("Fecha "+calendario.get(Calendar.DAY_OF_MONTH)+"/"+(calendario.get(Calendar.MONTH)+1)+"/"+calendario.get(Calendar.YEAR)+" dia "+Dias[calendario.get(Calendar.DAY_OF_WEEK)-1]); 
  11.              calendario.add(Calendar.YEAR, 1);
  12.         }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement