fork(18) download
  1. import java.text.ParseException;
  2. import java.text.SimpleDateFormat;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. class Main{
  6. public static void main(String[] args) throws ParseException {
  7. Calendar cal = Calendar.getInstance();
  8. cal.setTime(new SimpleDateFormat("MMM").parse("July"));
  9. System.out.println(cal.get(Calendar.MONTH) + 1);
  10. }
  11. }
Success #stdin #stdout 0.05s 246080KB
stdin
Standard input is empty
stdout
7