package devmanuals.com; import java.util.Queue; import java.util.LinkedList; public class QueueOfferElement { public static void main(String[] args) { Queue q = new LinkedList(); System.out.println("Initially the size of queue is " + q.size()); System.out.println("Elements in queue : " + q); q.offer("Ram"); q.offer("Shyam"); q.offer("Radhey Shayam"); System.out .println("After addition of elements into queue, the elements are : " + q); System.out.println("And the size of queue : " + q.size()); System.out.println("Now insert a new element 'JaiRam'"); boolean b = q.offer("Jai Ram"); System.out.println("Then the new Elements of queue are : " + q); System.out.println("Inserts the specified element : " + b); System.out.println("And the size of new queue = " + q.size()); } }