Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; public class JavaDequeremoveLastOccurrenceExample3 { public static void main(String[] args) { Deque
deque = new ArrayDeque<>(); deque.add(55.8f); deque.add(22.3f); deque.add(89f); deque.add(22.3f); boolean val = deque.removeLastOccurrence(22.3f); System.out.println("The value is already present in the deque : "+val); System.out.println("The final deque is given as : "); for (Float float1 : deque) { System.out.println(float1); } } }
Output