This topic has been archived. It cannot be replied.
-
工作学习 / IT杂谈 / 问题进一步具体化...奖品也我刚才的对问题的描述可能太泛泛, 让人难以回答,现将问题具体陈述如下:
有一个LinkedList Class,需要为它写一个LinkedListEnumeration Class,
题目的提示是这个Class要Implement Enumeration这个interface,
里边的constructor要以一个LinkedList 的object为parameter...
我想知道的就是如何implement这个constructor... :-)
(我个人理解就是如何将一个Enumeration Class跟一个Container Class联系起来.)
-wjiang(wjiang);
2001-4-10
{384}
(#43322@0)
-
How aboutclass ListNode {
Container data;
ListNode next;
....
}
public class List implements Enumeration {
private ListNode firstNode;
private ListNode lastNode;
public List(){
firstNode=lastNode=null;
}
public List(ListNode ){...}
public boolean hasMoreElements(){...}
public ListNode nextElement(){...}
....
}
-hotpot(麻辣烫);
2001-4-10
{388}
(#43336@0)
-
试一下这个,我认为比较贴题。运行看看
-firefox99(firefox99);
2001-4-11
{871}
(#43550@0)
-
有点问题,更正一下
-firefox99(firefox99);
2001-4-14
{1020}
(#45440@0)