I am having trouble understanding how to pass a linkdlist into a method that display that list as a stack. I am aware i havent specifed the type of list but my instructor said that it would not matter for this purpose. but I am still learning so I'm not to sure if I am passing the linkedlist correctly into the method.
import java.util.LinkedList ;
import java.util.ListIterator;
public class UseStacksAndQueues{
public static void main(String[] args) {
StacksAndQueues sQ = new StacksAndQueues();
String [] days = {"mon","tue","wed","thur","fri", "sat","sun"};
LinkedList aList = new LinkedList();
LinkedList newList = new LinkedList();
//load array of string objects into linked list
aList = sQ.methodOne(days);
//display linked list as a stack
sQ.methodTwo(aLits);
the method.
//display a linked list as a stack
public LinkedList methodTwo(aList){
for(int i = aList.size; i <= 0; i--)
{
System.out.println(aList.get(i));
}
}//end method two