Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; class Employee1{ private String f_name; private String l_name; private String email; public Employee1(String f_name, String l_name, String email) { this.f_name= f_name; this.l_name= l_name; this.email= email; } public String toString(){ return f_name+" " +l_name+" "+email; } } public class LinkedBlockingDequePopExample3 { public static void main(String[] args) { Employee1 employee1 = new Employee1("Reema ", "Panda ", "reemapanda18@gamil.com"); Employee1 employee2 = new Employee1("Geetanjali", "Sharma ", "geetanjaliSharma28@gamil.com"); Employee1 employee3 = new Employee1("Vineet ", "Tanjea ", "VineetTanjea56@gamil.com"); Employee1 employee4 = new Employee1("Himanshu ", "Bhardwaj", "himanshubhardwaj0604@gamil.com"); int capacity=100; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add(employee1); deque.add(employee2); deque.add(employee3); deque.add(employee4); for (Employee1 xyz : deque) { System.out.println(deque.pop()); } } }
Output