클래스 사이의 관계
public class Dialler {
private Vector digits;
int nDigits;
public void digit(int n);
protected boolean recordDigit(int n);
}
public class Employee {}
public class SalariedEmployee extends Employee {}
interface ButtonListener {}
public class ButtonDiallerAdapter implements ButtonListener {}
public class Phone {
private Button itsButtons[15];
}
public class PhoneBook {
private Vector itsPnos;
}
import java.util.Vector;
public class Addreass implements Cloneable {
private Vector itslines = new Vector();
public void setLine(int n, String line) {
if (n >= itsLines.size())
itsLines.setSize(n+1);
itsLines.setElementAt(line, n);
}
// 연관된 모든 항목들을 다 클론해준다.
public Object clone() throws CloneNotSupportedException {
Address clone = (Address)super.clone();
clone.itsLines = (Vector) itsLines.clone();
return clone;
}