Following program return the current weeks Tuesday date.
CurrentWeekTuesdayDate.java
package com.sample.app;
import java.util.Calendar;
public class CurrentWeekTuesdayDate {
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
System.out.println("Date " + calendar.getTime());
}
}
Output
Date Sat Jul 09 21:11:19 IST 2022
No comments:
Post a Comment