This is one of the typically asked Java interview questions in most of the Java interview.
Visit for more Java/J2EE interview questions series.
Regards,
Also visit author’s blog for more Java/J2EE interview questions
- public boolean offer(Object element): return false if the object cannot be added to the collection due to size issue and without throwing unchecked exception.
- public Object remove(): behaves like the Collection interface version.
- public Object poll(): behaves just like remove() but when invoked on empty collection returns null without throwing exception.
- public Object element(): for querying the element at the head of the queue. Throws exception when a collection is empty.
- public Object peek(): for querying the element at the head of the queue. Returns null if the collection is empty.
Visit for more Java/J2EE interview questions series.
Regards,
Also visit author’s blog for more Java/J2EE interview questions
No comments:
Post a Comment