package test;
class BirthDate {
private int day;
private int month;
private int year;
public BirthDate(int d, int m, int y) {
day = d;
month = m;
year = y;
}
public void display() {
System.out.println
(day + " - " + month + " - " + year);
}
}
public class Test{
public static void main(String args[]){
Test test = new Test();
BirthDate d1= new BirthDate(7,7,1970);
test.change(d1);
d1.display();
}
public void change(BirthDate b) {
b = new BirthDate(22,2,2004);
}
}
class BirthDate {
private int day;
private int month;
private int year;
public BirthDate(int d, int m, int y) {
day = d;
month = m;
year = y;
}
public void display() {
System.out.println
(day + " - " + month + " - " + year);
}
}
public class Test{
public static void main(String args[]){
Test test = new Test();
BirthDate d1= new BirthDate(7,7,1970);
test.change(d1);
d1.display();
}
public void change(BirthDate b) {
b = new BirthDate(22,2,2004);
}
}