我試圖在整型驅動程序類中調用此方法,但它不起作用。請誰能幫助我如何在驅動程序類中調用泛型方法
public SLL<T> missing(SLL<T> testList)
{
if(this.head == null)
{
return testList;
}
if(testList.head == null)
{
return null;
}
SLL<T> returnList = new SLL<T>();
Element<T> ptr = testList.head;
while(ptr!= null)
{
if(!isMember(ptr.data))
{
returnList.append(ptr.data);
return returnList;
}
ptr = ptr.next;
}
return returnList;
}
你是怎麼稱呼它的?什麼不工作?在驅動程序類中調用方法 – algrid
。我不知道如何調用它,我在驅動類中創建了一個對象,我需要給它檢查一個整數 – Armee
@Armee提示:如果你沒有發佈它,我們就看不到你的代碼。發佈你的嘗試。發佈您獲得的確切完整的錯誤消息。 –