Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; import java.util.Scanner; public class JavaDequecontainsExample3 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Deque
deque = new ArrayDeque<>(); System.out.println("The list of vowels is given as : "); deque.add('a'); deque.add('e'); deque.add('i'); deque.add('o'); deque.add('u'); System.out.println(deque); Object b = null; boolean val = deque.contains(b); if (val == true) { System.out.println("The alphabet is a vowel."); } else { System.out.println("The alphabet is not a vowel."); } } }
Output