class Mydate {
private int year, month, day;
public String getDate() {
return year + "/" + month + "/" + day;
}
public int setDate(int y, int m, int d) {
if ((m > 0 && m <= 12) && (d > 0 && d <= 31)) {
year = y;
month = m;
day = d;
return 0;
} else {
return 1;
}
}
}
public class TestMyDate {
public static void main(String[] args) {
Mydate d = new Mydate();
if (d.setDate(2011, 11, 5) == 0)
System.out.println(d.getDate());
}
}