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());
  }// w  w  w  .  ja  va2 s . co m

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

Related Exercise