public class Main {
public static void main(String[] args) {
Distance a = new Distance();
a.setDistance(3);
System.out.println("a의 값 : " + a.getDistance());
Distance b = new Distance();
b.setDistance(5);
System.out.println("b의 값 : " + b.getDistance());
Distance c = b;
c.setDistance(7);
System.out.println("c의 값 : " + c.getDistance());
System.out.println("b의 값 : " + b.getDistance());
}
}
a의 값 : 3
b의 값 : 5
c의 값 : 7
b의 값 : 7