Java - Write code to get current date from Calendar

Requirements

Write code to get current date from Calendar

Demo

import java.util.Calendar;

public class Main {
  public static void main(String[] argv) {
    System.out.println(getNowday());
  }/*from  w w w.ja  va  2s.c o m*/

  public static int getNowday() {
    Calendar cc = Calendar.getInstance();
    return cc.get(Calendar.DATE);
  }
}

Related Exercise