Noob Java question:
Could someone explain the difference between
1. Queue<Integer> q = new LinkedList<Integer>() and
2. LinkedList<Integer> q = new LinkedList<Integer>()
in Java? I had assumed that in declaration 1., I wouldn't be able to use LinkedList specific methods and could only use those described by the Queue interface. However, I just tried q.size() and found that that worked, although that is not a part of the Queue interface.
Is the difference in passing these objects as parameters? What is the difference?