나는 "UnsuportedOperationException"얻을 코드를 실행할 때 나는 데이터 구조가 매개 변수 ::여러 생성자
DictionaryI<IPAddress,String> ipD; //declaring main structure using interface
// Constructor, the type of dictionary to use (hash, linkedlist, array)
// and the initial size of the supporting dictionary
public IPManager(String dictionaryType, int initialSize){
if(st1.equals(dictionaryType))
ipD = new LinkedListDictionary();
if(st2.equals(dictionaryType))
ipD = new HashDictionary(initialSize);
if(st3.equals(dictionaryType))
ipD = new ArrayDictionary(initialSize);
else
throw new UnsupportedOperationException();
}
에 문자열에 의해 결정됩니다 사용하는 생성자를 설정하기 위해 노력하고있어 내가 무엇을 넣든 상관없이 어떤 도움이나 올바른 방향으로 향한 점이 크게 감사 할 것입니다!
는
st1, st2 및 st3을 제공하도록 신경을 씁니까? –
st1 = "연결 목록" st2 = "해시" st3 = "배열" – JeffS