(Choose 1 answer)
Specify the correct implementation of pop() method of a stack. 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(Object x)
{ if (isEmpty()) return(null);pool.remove(pool.size()-1);}
B. Object pop(){ if (isEmpty()) return(null);return(pool.removeLast());}
C. Object pop()
{if (isEmpty()) return;return(pool.remove(pool.size()-1));}
D. Object pop()
{ if (isEmpty()) return(null);return(pool.remove(pool.size()));}