Java Deque push() MethodThe push() method of Deque interface is used to push an element on the stack represented by the given deque. The above method is equivalent to addFirst() method. Syntax:Parameter:The above requires only one parameter:
Throw:
Example 1Test it NowOutput: The final deque is given as : a b c d Example 2Test it NowOutput: The final deque is : [Hello, , World] Example 3Test it NowOutput: The resultant deque is represented as : 85 75 65 55 Next TopicJava Deque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India