Touchstone57
03-03-2009, 06:33 PM
Sorry, asking for help, again! I'm still fairly new with this programming lark.
Basically I'm trying to create a Stack in my PublicLibrary class, but having difficulty getting it working. So far, I can only use the stack created in the PublicLibrary in my main method which is TestLibraries.
public class PublicLibrary {
public Stack<LibraryItem> PublicLibraryStack = new Stack<LibraryItem>();
}
My thoughts here would be to for the next line to be
PublicLibraryStack.<INVOKE OPERATION>
But no operations are given available. The only way I can manipulate my stack is in my main method, using this code, in my other class.
PublicLibrary pl = new PublicLibrary()
pl.PublicLibraryStack.<WHATEVER OPERATION> //eg. add()
So how can I get one created inside my PublicLibrary class? Any help would be greatly appreciated, thanks.
Basically I'm trying to create a Stack in my PublicLibrary class, but having difficulty getting it working. So far, I can only use the stack created in the PublicLibrary in my main method which is TestLibraries.
public class PublicLibrary {
public Stack<LibraryItem> PublicLibraryStack = new Stack<LibraryItem>();
}
My thoughts here would be to for the next line to be
PublicLibraryStack.<INVOKE OPERATION>
But no operations are given available. The only way I can manipulate my stack is in my main method, using this code, in my other class.
PublicLibrary pl = new PublicLibrary()
pl.PublicLibraryStack.<WHATEVER OPERATION> //eg. add()
So how can I get one created inside my PublicLibrary class? Any help would be greatly appreciated, thanks.