I have an add method that inserts the latest string of text to the end of a list where I want it to insert as the first string of text. Any help is appreciated. Here is the method:
public void add (Magazine mag)
{
MagazineNode node = new MagazineNode (mag);
MagazineNode current;
if (list == null)
list = node;
else
{
current = list;
while (current.next != null)
current = current.next;
current.next = node;
}
}
Assuming I understand want you need, which might be off, I think you’re wanting the following method.