![]() ![]() ![]()
Какой рейтинг вас больше интересует?
|
Главная /
Каталог блоговCтраница блогера Yarixxx/Записи в блоге |
![]() |
|
Deque
2015-06-16 16:06:34 (читать в оригинале)The main specificity of Deque is that it provides methods to add and remove elements from both sides. In the same way as Queue this interface provides methods with two versions: one that throws some special exceptions and another one that makes it silent. Since it is a sub-interface it also has methods from Queue. […]
NoSuchElementException on Deque
2015-06-16 15:01:02 (читать в оригинале)This exception is quite similar to NoSuchElementException on Queue. The following code leads to such an exception: Deque q = new ArrayDeque(); q.removeFirst(); and here is a stacktrace: Exception in thread "main" java.util.NoSuchElementException at java.util.ArrayDeque.removeFirst(ArrayDeque.java:280) ... There is another way to get NoSuchElementException. We can call getLast or getFirst on a empty Deque. Deque q […]
Sub-interfaces of Queue interface
2015-06-16 14:35:56 (читать в оригинале)Queue interface has several sub-interfaces: Deque which has no threads specificity and BlockingDeque which relies on Java threads functionality
IllegalStateException on Deque
2015-06-16 14:35:19 (читать в оригинале)In order to catch IllegalStateException on Deque we can use the following code: Deque q = new LinkedBlockingDeque(2); q.addFirst(1); q.addFirst(3); q.addFirst(4); it will give us special exception: Exception in thread "main" java.lang.IllegalStateException: Deque full at java.util.concurrent.LinkedBlockingDeque.addFirst(LinkedBlockingDeque.java:326)
IllegalArgumentException on Queue
2015-06-16 13:53:09 (читать в оригинале)As it is declared in documentation IllegalArgumentException happens on Queue when initial capacity is 0 and we are trying to add new element. Queue q = new PriorityQueue(0); q.add(1); the IllegalArgumentException stacktrace will be the following: Exception in thread "main" java.lang.IllegalArgumentException at java.util.PriorityQueue.(PriorityQueue.java:167) at java.util.PriorityQueue.(PriorityQueue.java:135)
Тэги: illegalargumentexception, java, priorityqueue, queue, uncategorized
Комментарии | Постоянная ссылка
![BlogRider сегодня BlogRider сегодня](/themes/1/i/menu/th/blogrider_today.png)
![Изменения рейтинга Изменения рейтинга](/themes/1/i/menu/th/rating_changes.png)
Категория «Музыка»
Взлеты Топ 5
![]() | ||
+382 |
399 |
Follow_through |
+328 |
331 |
שימותו הקנאים |
+320 |
334 |
Tomas50 |
+317 |
357 |
krodico |
+307 |
359 |
Ланин Сергей |
Падения Топ 5
![]() | ||
-4 |
42 |
Similis_Deo |
-5 |
2 |
Dark Music in Your Heart | Dark Music in Your Heart |
-6 |
9 |
BrightBand |
-15 |
135 |
Музпросвет в мыслях |
-16 |
167 |
Trance Music - Транс музыка |
![Главные темы Главные темы](/themes/1/i/menu/th/main_themes.png)
Популярные за сутки
Загрузка...
![Загрузка... Загрузка...](/themes/1/i/loader/loader.gif)
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.
взяты из открытых общедоступных источников и являются собственностью их авторов.