GregorianCalendar class setGregorianChange(Date date)method example

Sets the GregorianCalendar change date.


GregorianCalendarclass setGregorianChange(Date date)method example. This example shows you how to use setGregorianChange(Date date)method.This method Sets the GregorianCalendar change date.

Here is the code:-

/**
 * @Program that Sets the GregorianCalendar change date.
 * SetGregorianChange.java 
 * Author:-RoseIndia Team
 * Date:-27-May-2008
 */
import java.util.*;

public class SetGregorianChange {

    public static void main(String[] args) {
        GregorianCalendar g = new GregorianCalendar(2004615);
//Displays the date of the Calendar
        System.out.println("Current DATE of the Calendar is: " + g.get(Calendar.DATE));
        Date d = new Date(2008313);
//Sets the GregorianCalendar change date.
        g.setGregorianChange(d);
        System.out.println("Current DATE of the Calendar is: " + g.get(Calendar.DATE));
    }
}

Output of the program:-
Current DATE of the Calendar is: 15
Current DATE of the Calendar is: 2

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US