Find number of whole weeks between months in the same year I wrote a class to return the number of whole weeks between months in the same year. I need suggestions on my code.

public int year;
public String m1;
public String m2;


public Solution(int Y, String A, String B) throws ParseException {
    this.year = Y;
    this.m1 = A;
    this.m2 = B;


    String dateOneInput = year + "-" + m1;
    String dateTwoInput = year + "-" + m2;

    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MMM");

    //DATE 1
    Calendar c1 = Calendar.getInstance();
    c1.setTime(formatter.parse(dateOneInput));
    //Get first monday of the month
    c1.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    c1.set(Calendar.DAY_OF_WEEK_IN_MONTH, 1);

    System.out.println("Date 1 : " + c1.getTime());

    //DATE 2
    Calendar c2 = Calendar.getInstance();
    c2.setTime(formatter.parse(dateTwoInput));
    //Get last sunday of the month
    c2.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    c2.set(Calendar.DAY_OF_WEEK_IN_MONTH, -1);

    System.out.println("Date 2 : " + c2.getTime());

    //Difference in weeks
    int weeks = c2.get(Calendar.WEEK_OF_YEAR) - c1.get(Calendar.WEEK_OF_YEAR);
    System.out.println("Number of weeks :" + (1 + weeks));

}

/**
 * @param args the command line arguments
 * @throws java.text.ParseException
 */
public static void main(String[] args) throws ParseException {
    Solution s = new Solution(2012, "June", "July");
}
public int year;
public String m1;
public String m2;


public Solution(int Y, String A, String B) throws ParseException {
    this.year = Y;
    this.m1 = A;
    this.m2 = B;



These fields shouldn't be public. By making them public you've exposed them to the outside world. These are internal details that should be properly encapsulated. Truthfully though, you don't need them at all. I would just work directly with the arguments that you passed in. Rename them though. Your current names don't tell the client what kind of values to expect. What's an "A"? How would another dev know what to pass into this method without looking at the internals? They wouldn't. 

public Solution(int year, String startMonth, String endMonth) throws ParseException