Сегодня 14 февраля, пятница ГлавнаяНовостиО проектеЛичный кабинетПомощьКонтакты Сделать стартовойКарта сайтаНаписать администрации
Поиск по сайту
 
Ваше мнение
Какой рейтинг вас больше интересует?
 
 
 
 
 
Проголосовало: 7278
Кнопка
BlogRider.ru - Каталог блогов Рунета
получить код
Yarixxx
Yarixxx
Голосов: 1
Адрес блога: http://y3x.ru
Добавлен: 2010-12-17 00:20:50 блограйдером yarix
 

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)


Страницы: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 

 


Самый-самый блог
Блогер Рыбалка
Рыбалка
по среднему баллу (5.00) в категории «Спорт»
Изменения рейтинга
Категория «Музыка»
Взлеты Топ 5
+382
399
Follow_through
+328
331
שימותו הקנאים
+320
334
Tomas50
+317
357
krodico
+307
359
Ланин Сергей
Падения Топ 5


Загрузка...Загрузка...
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.