Logo
TGCATALOG
Catalog Collections Blog
Java | Interview questions

Java | Interview questions

Questions and answers for Java developer interviews.

No ratings
324
01.12.2026
324
01.12.2026
No ratings
324
01.12.2026
Safe redirect via bot
О канале

Questions and answers for Java developer interviews.

Подписчиков —
Тематика Technology
Ссылка @easy_java_ru

We also recommend

Kekaton AI | Voiceover and voice clone
Kekaton AI | Voiceover and voice clone
Bot

AI bot for text-to-speech and voice cloning in Telegram. Create audio using neural network quickly and easily.

Description

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.

Latest posts

Java | Interview questions
Java | Interview questions
🔒Открыть пост
и посмотреть медиа
🤔 Каким образом можно заставить поток выполнится приоритет и есть ли такая возможность в Java? В Java у каждого потока есть приоритет, но он не гарантирует порядок выполнения. 🟠Использование `setPriority(int priority)` Java позволяет задавать приоритет потока с помощью метода setPriority(), который принимает значение от 1 до 10: Thread.MIN_PRIORITY (1) – минимальный приоритет Thread.NORM_PRIORITY (5) – стандартный приоритет (по умолчанию) Thread.MAX_PRIORITY (10) – максимальный приоритет class MyThread extends Thread { public MyThread(String name, int priority) { super(name); setPriority(priority); } @Override public void run() { for (int i = 0; i < 5; i++) { System.out.println(getName() + " выполняется с приоритетом " + getPriority()); } } } public class Main { public static void main(String[] args) { MyThread low = new MyThread("Low Priority", Thread.MIN_PRIORITY); MyThread high = new MyThread("High Priority", Thread.MAX_PRIORITY); low.start(); high.start(); } } 🟠Почему `setPriority()` не даёт 100% контроль? Приоритет – это всего лишь рекомендация для ОС. Распределение процессорного времени зависит от планировщика ОС. В Windows, Linux, macOS приоритеты работают по-разному, и Java не контролирует их на низком уровне. 🟠Как действительно заставить поток выполниться первым? Реальные способы управления порядком выполнения: а) Использование join() Позволяет дождаться выполнения одного потока перед запуском другого. public class Main { public static void main(String[] args) throws InterruptedException { Thread high = new MyThread("High Priority", Thread.MAX_PRIORITY); Thread low = new MyThread("Low Priority", Thread.MIN_PRIORITY); high.start(); high.join(); // Ждём, пока high завершится low.start(); // Теперь запускается low } } б) Использование Executors.newSingleThreadExecutor() Позволяет гарантированно выполнять потоки по очереди. import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Main { public static void main(String[] args) { ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(() -> System.out.println("Задача 1")); executor.submit(() -> System.out.println("Задача 2")); executor.shutdown(); } } Ставь 👍 и забирай 📚 Базу знаний
Java | Interview questions
FAQ

Open Java | Interview questions in Telegram and press the Start button. No separate registration is required.

Yes. The service is designed to be straightforward: open the resource, follow the on-screen instructions and start using it.

No. You can use Java | Interview questions directly in Telegram unless the resource description says otherwise.

Access depends on the resource. Check the current information in Telegram after opening Java | Interview questions.

The exact features depend on the resource. Open Java | Interview questions to see its current functions, content and access conditions.

Reviews for channel Java | Interview questions

Log in to leave a review

Only registered users can share their opinion.

No reviews yet

Be the first to share your impression of this resource!

Similar resources

Loading
Switch to Light Theme
Home Catalog Collections Blog Login