Advertisement
mmayoub

Main Program - Date

Mar 10th, 2023
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | Software | 0 0
  1. public static void main(String[] args) {
  2.         int day, month;
  3.         Date date;
  4.  
  5.         Scanner in = new Scanner(System.in);
  6.         System.out.print("Enter day: ");
  7.         day = in.nextInt();
  8.         System.out.print("Enter month: ");
  9.         month = in.nextInt();
  10.         in.close();
  11.  
  12.         date = new Date(day, month);
  13.         for (int i = 1; i <= 10; i++) {
  14.             System.out.println(date.dateAfter(i));
  15.         }
  16.     }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement