Закрыть
×
=0) { let js = text.slice(pos1, pos2); + '<\/' + "script" + '>'; arrText.push(js); // next pos1 = pos2; continue; } } } break; } return arrText; } function OpenDialog(parentDiv, urlContent) { parentDiv = document.getElementById('modal-background'); // new !!!!!!! parentDiv.appendChild(document.getElementById('modal-template')); document.getElementById('modal-background').style.display = "flex"; // !!!!! block document.getElementById('modal-template').style.display = "flex"; // !!!!! document.getElementById('modal-body').innerHTML = ""; post_url(urlContent, "", function(text_from_server) { var element = document.getElementById('modal-body'); element.innerHTML = text_from_server; // add scripts var arrJSText = get_scripts(text_from_server); for (var i=0; i
dir.by
Праздники ...
Праздники ...
День Октябрьской революции (7 Ноября)
Концерты, выставки ...
Концерты, выставки ...
Спектакль "Камедыя"|||г. Минск 16 сентября, 24 сентября, 8 октября, 5 ноября, 12 ноября 2026
Афишу
Спорт занятия ...
Спорт занятия ...
Занятия в тренажерном зале
Спорт занятие
Компьютер, программы...
Компьютер, программы...
Объявления ...
Объявления ...
Музыкальная школа
Объявление
Новости ...
Новости ...
Форум ...
Форум ...
обсуждение...
<<
Поиск >>
Поиск
Концерты
Спорт
Форум
Компьютер
Компьютер, программы
→
Java
→
Java (class, interface, collections, etc.)
interface Deque
in Java
посмотрели
1219
раз
обновлено: 29 September 2026
interface Deque<E>
is a two-way queue, i.e. adding, removing elements from the beginning and end.
Java
interface
Deque
<E>
extends
Collection
<E>
{
Hide Functions << ...
Let's look at Functions >> ...
void
addFirst
(E e);
// Add an element to the
start of
of the queue
void
addLast
(E e);
// Add an element to the
end of
of the queue
boolean
offerFirst
(E e);
// Add an element to the
start of
of the queue
boolean
offerLast
(E e);
// Add an element to the
end of
of the queue
E
removeFirst
();
//
Removes
element from the
start of
of the queue
E
removeLast
();
//
removes
item from
end of
queue
E
pollFirst
();
// Take an element from the
start of the
queue, the element
is deleted
E
pollLast
();
// Take an element from the
end of
of the queue, element
is deleted
E
getFirst
();
// Look at the element at the
beginning of
of the queue
E
getLast
();
// Look at the item at the
end of the
queue
E
peekFirst
();
// Look at the element at the
beginning of
of the queue
E
peekLast
();
// Look at the item at the
end of the
queue
void
push
(E e);
// Add an element to the
start of
of the queue
E
pop
();
// Take an element from the
start of the
queue, the element
is deleted
boolean
remove
(
Object
o);
boolean
contains
(
Object
o);
boolean
addAll
(
Collection
<?
extends
E> c);
Iterator
<E>
iterator
();
Iterator
<E>
descendingIterator
();
}
Java collections based on
interface Deque<E>
Java
class
LinkedList
<E>
class
LinkedList
is a set of Nodes. Each Node has 2 links: a link to the next Node and a link to the previous Node.
In
LinkedList
can add and remove elements.
LinkedList
is not synchronized.
Read more
class LinkedList<E> ...
synchronized for threads
❌
Java
class
ArrayDeque
<E>
ArrayDeque oracle.com ...
Java
class
LinkedBlockingDeque
<E>
LinkedBlockingDeque oracle.com ...
Java
class
ConcurrentLinkedDeque
<E>
ConcurrentLinkedDeque oracle.com ...
← Previous topic
interface Queue<E> in Java
Next topic →
class LinkedList<E> in Java
Your feedback ... Comments ...
Your Name
Your comment
(www links can only be added by a logged-in user)
+ Picture
Download and install
•
Installation JDK (download and install the Java library for Windows)
•
Download and install IntelliJ IDEA to explore Java, Spring, Jakarta EE | Functionality and differences: Community | Ultimate
•
Error "JDK is missing" | Java
Java (class, interface, collections, etc.)
•
Create a simple console app in IntelliJ IDEA to learn Java
•
Access modifiers (private, protected, public) for a class and for methods and fields. | Java
•
Collections in Java
•
interface List<E> in Java
•
class ArrayList<E> in Java
•
class Vector<E> in Java
•
class Stack<E> in Java
•
class CopyOnWriteArrayList<E> in Java
•
interface Queue<E> in Java
•
interface Deque<E> in Java
•
class LinkedList<E> in Java
•
interface Set in Java
•
class HashSet<E> in Java
•
class LinkedHashSet<E> in Java
•
interface Map in Java
•
class HashMap<K,V> in Java
•
class LinkedHashMap<K,V> in Java
•
Collections.singletonList("Hello") returns an immutable list containing exactly one specified element | Java collection
•
class Collections (all functions, algorithms) | Java
•
stream.filter(...) select elements according to your criterion | Java collection | Example: allCars.stream().filter(item -> item.Price < 30000).toList()
•
What is interface in Java ?
•
You can add static functions to the interface | Java
•
In the interface, using default, we create an implementation of the | this appeared in Java 8
•
Directly in the code (at runtime) we make an implementation for the interface | Java
•
Threads in Java
•
lambda is an unnamed method (no name and no class owned) | Java
•
Exceptions and handling in Java. Example: try {...} catch (Exception e) {...}
•
Why use throws Exception in the function name in Java? Answer: The method throws an exception and there is no handling of try catch. Example: float CalculateDensity(float mass, float volume) throws Exception { ... throw new Exception("Error! Volume is zero."); ... }
Java web application (servlet, jsp page, basic functionality and no frameworks)
•
Creating a new simple web application (jsp web page) | Java, Maven
•
Create a web servlet (the servlet is located on the web server, returns the result on request) | Java
•
Installation Tomcat web server (download and install for Windows)
•
Check, test Tomcat web server (create a new my.hml file)
•
What is Maven
•
What is a dynamic web page jsp (Java Server Page) ?
•
How to install Smart Tomcat plugin in Intellij Idea
•
Error "The SDK is not specified for module ... | Project SDK is not defined ..." in IntelliJ IDEA | Java
Spring in Java (Spring Framework, Spring Data, Spring Boot, ...)
•
What is Spring? Why use Spring in Java?
•
What is Spring Bean? What is Spring Container? IoC (inversion of control) | Creating a simple Spring project and configuration Spring Container in an XML file | Editor IntelliJ Idea and language Java
•
What is Dependency Injection in Spring? Creating a simple Spring project with Dependency Injection in the constructor with the attributes @Component, @Autowired | Editor IntelliJ Idea and language Java
•
Create a new Spring Web application (the request goes to the Controller → Controller creates a response as text or json) | Java, Spring Web, Spring Boot, Maven
•
Creating a new Spring WebSocket application (Java WebSocket sends a message to the JavaScript WebSocket) | Java, Spring WebSocket, Spring Boot, Maven
•
Create Azure Web App with the type Java (free). That is, create an empty web server
•
Put the Java Spring web application in Azure
•
Connect to the application Azure Web App (Java) via FTP | use File Explorer
•
Error "The SDK is not specified for module ... | Project SDK is not defined ..." in IntelliJ IDEA | Java, Spring Boot
•
How to install Spring WebSocket plugin in Intellij Idea
Jakarta EE / Java EE in Java (Web Applications, Web Services)
•
What is Jakarta EE (Java EE)? | In which editor (program) is it convenient to write Jakarta EE (Java EE) code?
•
Creating a simple web project in IntelliJ Idea Ultimate | Jakarta EE (Java EE)
Struts in Java (extends API Java Servlet using MVC)
•
What is Struts | Java
Courses, training
•
Course "Java developer" from Yandex
Interview
•
Interviews on Java
Ваши вопросы присылайте по почте:
info@dir.by