Why does it compile? ArrayList does not have poll method. it doesn't inherit it either. I tried to read API several times. The poll method is in Queue,
so I think the line #1 can be only the line below.
Queue<String> x = new PriorityQueue<String>();
What am I missing here? Please explain.
This is my first time asking question here, so forgive me if this is not the right place to post a question.