1
Stack s=new Stack();
LinkedList qeue = new LinkedList();

public void pushCharacter(char ch) {
    s.push(ch);
}
public void enqueueCharacter(char ch) {
    qeue.addLast(ch);
}
public char popCharacter() {
    s.pop();
    return  // ?11
}
Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142

1 Answers1

1
return s.pop();

Stack#pop "removes the object at the top of this stack and returns that object as the value of this function". You must have a Stack<Character>, though. Don't use raw types.

Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
  • 1
    Just to note this he also needs to cast it to `char` in this case since that is his return type for the method and he is using `Stack` not `Stack`, or just define it correctly as `Stack` since thats what he wants anyway. – Nexevis Aug 22 '19 at 12:39