Java GregorianCalendar BC

Syntax

GregorianCalendar.BC has the following syntax.

public static final int BC

Example

In the following code shows how to use GregorianCalendar.BC field.


import java.util.Calendar;
import java.util.GregorianCalendar;
//from ww  w.j a  v  a2s  .  c  om
public class Main {

   public static void main(String[] args) {

      GregorianCalendar cal = new GregorianCalendar();
      
      cal.set(Calendar.ERA, GregorianCalendar.BC);
      
      System.out.println(cal.getTime());
      

   }
}

The code above generates the following result.