Online Java Compiler By
JavaTpoint.com
import java.util.Date; public class JavaDateGetMontExample1 { public static void main(String[] args) { Date d=new Date(); System.out.println("Month of the year is : "+d.getMonth()); } }
Output