Im having trouble with my stack program and I don't really understand my errors. Can I please get some help? Every time i try to run it, it has multiple errors and im extremely confused on a few things. the errors i have is a total of 60 errors. therefore the whole program is off. All im trying to do is to create names in this stack and queue program.
public class YourStackNB {
private int maxSize;
private long[] stackArray;
private int top;
public YourStackNB(int s) {
maxSize = s;
stackArray = new long[maxSize];
top = -1;
}
public void push(long j) {
stackArray[++top] = j;}
public long pop() {
return stackArray[top--];
}
public boolean isEmpty() {
return (top == -1);
}
public static void main(String[] args) {
YourStackNB theStack = new YourStackNB();
Stack<Name> even = new Stack<>();
theStack.push(dino);
theStack.push(perry);
theStack.push(jada);
theStack.push(holly);
theStack.push(nori);
while (!theStack.isEmpty()) {
long value = theStack.pop();
System.out.print(value);
System.out.print(" ");
}
System.out.println("");
}
}