Tuesday, November 30, 2010

Lab 22 -- ListNode


1) Remove quotes around E.

public class ListNode<"E"> 
{
 private E data;
 private ListNode<"E"> link;
 
 public ListNode()
 {
  link = null;
  data = null;
 }
 
 public ListNode(E newData, ListNode linkValue)
 {
  data = newData;
  link = linkValue;
 }

 public E getData() {
  return data;
 }

 public void setData(E data) {
  this.data = data;
 }

 public ListNode<"E"> getLink() {
  return link;
 }

 public void setLink(ListNode<"E"> link) {
  this.link = link;
 }
 
 
}

No comments: