и посмотреть медиа
Java | Interview questions
и посмотреть медиа
Questions and answers for Java developer interviews.
Questions and answers for Java developer interviews.
AI bot for text-to-speech and voice cloning in Telegram. Create audio using neural network quickly and easily.
Selection of typical questions in Java interviews: from JVM basics to Spring and Hibernate. Each question with detailed explanation, code examples, and tips. Suitable for all levels.
🤔 Какая коллекция реализует дисциплину обслуживания FIFO? FIFO (First-In, First-Out) – это принцип обработки данных: "первым вошёл – первым вышел". 🟠Коллекции, реализующие FIFO Пример работы FIFO с Queue import java.util.*; public class FifoExample { public static void main(String[] args) { Queue queue = new LinkedList(); // Можно заменить на ArrayDeque queue.add("Первый"); queue.add("Второй"); queue.add("Третий"); System.out.println(queue.poll()); // Первый System.out.println(queue.poll()); // Второй System.out.println(queue.poll()); // Третий } } 🟠Разница `poll()`, `remove()` и `peek()` Queue queue = new LinkedList(); queue.add(10); System.out.println(queue.peek()); // 10 (но не удаляет) System.out.println(queue.poll()); // 10 (удаляет) System.out.println(queue.poll()); // null (очередь пуста) Ставь 👍 и забирай 📚 Базу знаний
Открыть канал и посмотреть медиаOnly registered users can share their opinion.
Be the first to share your impression of this resource!