/* package whatever; // don't place package name! */

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String date = "06/25/20014";
		try {
            String validDate = "MM/dd/yyyy";    
            SimpleDateFormat format = new SimpleDateFormat(validDate);
            format.setLenient(false);
            Date theDate = format.parse(date);
            Calendar c = new GregorianCalendar();
            c.setTime(theDate);
            int year = c.get(Calendar.YEAR);
            int month  = c.get(Calendar.MONTH);
            int day  = c.get(Calendar.DAY_OF_MONTH);
            int pos = c.get(Calendar.DAY_OF_WEEK);
            if (Calendar.WEDNESDAY == pos) 
              System.out.print("day is Wednesday on " + year + "/" + (month+1) + "/" + day);
        }
        catch (ParseException e) {
           System.out.print("Cought exception " + e ); 
        }
	}
}