package apples;
public class cup {
private int month;
private int day;
private int year;
public cup (int m, int d, int y) {
month = m;
day = d;
year = y;
System.out.printf("the constructor for this is %s\n", this);
}
public String toString() {
return String.format("%d/%d/%d",month, day, year);
}
}
package apples;
public class boy {
public static void main (String []args) {
cup cupObject = new cup(4,5,6);
}
}
Comments
Post a Comment