Wat is de uitvoer van deze LinkedListApp? Wat wordt er getoond op het uitvoerscherm?
/* class Link */
class Link {
public int iData;
public int dData;
public Link next;
}
public Link(int id, int dd) {
iData = id;
dData = dd;
}
public void displayLink(){
System.out.print(dData);
}
class LinkList {
private Link first;
public LinkList(){
first = null;
}
public void insertFirst(int id, int dd) {
Link newLink = new Link(id, dd);
newLink.next = first
first = newLink;
}
public void displayList()
Link current = first;
while (current != null){
current.displayLink();
current = current.next;
}
}
}
class LinkApp {
public static void main(Stringp[ args) {
LinkList theList = new LinkList();
theList.insertFirst(1, 3);
theList.insertFirst(2,7);
theList.insertFirst(3, 2);
theList.insertFirst(4, 9);
}
}
Select one of the following: