The code you provided is a Java program that uses the java.util package to get the day of the week for the current date and print it to the console. Here is a breakdown of the code:
Note that the Calendar class is a legacy class in Java that has been replaced by the newer java.time package since Java 8. You can use the java.time.DayOfWeek enum to get the day of the week in the newer API.
import java.util.*; public class DayWeek_SpecificDate { public static void main(String []args) { Calendar cal = Calendar.getInstance(); int dow = cal.get(Calendar.DAY_OF_WEEK); System.out.println("Day of the Week : " + dow); } }
Day of the Week : 7
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions