Q:

Java Program to print date using java program

0

Program to print date using java program

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.util.*;
import java.lang.*;
import java.io.*;

public class demo1
{
   public static void main(String args[])
   {
      int day, month, year;
      GregorianCalendar date = new GregorianCalendar();
 
      day = date.get(Calendar.DAY_OF_MONTH);
      month = date.get(Calendar.MONTH);
      year = date.get(Calendar.YEAR);
      System.out.println("Current date is  "+day+"/"+(month+1)+"/"+year);
   }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now