09 April 2012

Get Method

import java.util.Calendar;
public class GetMethod  {
 public static void main(String[] av) {
 Calendar calendar = Calendar.getInstance(); 
  System.out.println("Year: " + calendar.get(Calendar.YEAR));
  System.out.println("Mnth: " + calendar.get(Calendar.MONTH));
  System.out.println("Day: " + calendar.get(Calendar.DAY_OF_MONTH));
  System.out.println("Day of week = " + calendar.get(Calendar.DAY_OF_WEEK));
  System.out.println("Day of year = " +calendar.get(Calendar.DAY_OF_YEAR));
  System.out.println("Week in Year: " + calendar.get(Calendar.WEEK_OF_YEAR));
  System.out.println("Week in Mnth: " + calendar.get(Calendar.WEEK_OF_MONTH));
  System.out.println("Day of Week in Mnth: "
  + calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
  System.out.println("Hour (24-hour clock): "
  + calendar.get(Calendar.HOUR_OF_DAY));
  System.out.println("Mint: " + calendar.get(Calendar.MINUTE));
  System.out.println("Secnd: " + calendar.get(Calendar.SECOND));
  }
}

1 comments:

Naviya Nair said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Online Training Java EE Online Training Java EE Online Training Java 8 online training Core Java 8 online training

Java Online Training from India Java Online Training from India Core Java Training Online Core Java Training Online Java Training InstitutesJava Training Institutes

Post a Comment

Related Posts with Thumbnails

Popular Posts

 
;