(Choose 1 answer)
Specify the correct implementation of pop() method of a stack of Integers. This stack uses
java.util.LinkedList for storing data and the end of the list is treated as the top of the stack. (Choose the most suitable one)
A. void pop(Integer x)
{ if (isEmpty()) return(null);pool.remove(pool.size()-1);}
B. Integer pop()
{ if (isEmpty()) return(null);return((Integer) pool.removeLast());}
C. Integer pop()
{if (isEmpty()) return;return((Integer) pool.remove(pool.size()-1));}
D. Integer pop()
{ if (isEmpty()) return(null);return((Integer) pool.remove(pool.size()));}
12