Чашечка Java
الذهاب إلى القناة على Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
إظهار المزيد8 282
المشتركون
-124 ساعات
-37 أيام
-7130 أيام
أرشيف المشاركات
8 282
Top Java Blogs Weekly: Best of 8/2023
Best of Top Java Blogs, year 2023, week 8
Read: https://www.topjavablogs.com/news/best-of-8-2023
8 282
Producer Consumer Problem with Wait and Notify - Thread Example Tutorial
The Producer-Consumer Problem is a classical concurrency problem and in fact, it is one of the most powerful concurrency design patterns which is used in most multithreaded Java applications. In the last article, I have shown you how to solve the Producer-Consumer problem in Java using blocking Queue but one of my readers emailed me and requested a code example and explanation of solving the Producer-Consumer problem in Java with the wait and notify method as well Since it's often asked as one of the top coding questions in Java. In this Java tutorial, I have put the code example of the wait notify version of the earlier producer-consumer concurrency design pattern.
Java Interview questions and tutorials
Read: http://www.java67.com/2012/12/producer-consumer-problem-with-wait-and-notify-example.html
8 282
Java CountDownLatch Example for Beginners - [Multithreading Tutorial]
Hello Java programmers, the CountDownLatch is an important concurrency utility class that was added in JDK 1.5 to facilitate inter-thread communication without using wait and notify methods, but unfortunately, many Java developers still struggle to understand and use this powerful tool. In this article, you will learn what is CountDownLatch and how to use it to write better concurrent applications in Java. You can use the CountDownLatch if you are spawning multiple threads to do different jobs and want to know when exactly all tasks are finished so that you can move to the next stage. In other words,you can block a thread until other threads complete their task.
Java Interview questions and tutorials
Read: http://www.java67.com/2018/04/java-countdownlatch-example-when-and-how.html
8 282
У нас для вас отличные новости! Наш сайт обновился и теперь может уведомлять по почте и в Telegram о новых материалах, которые интересны именно вам
Для этого вам нужно:
1. Авторизоваться на сайте tproger.ru
2. Зайти в свой профиль и подписаться на интересные вам теги в разделе «Подписки». Например, библиотеки, инструменты и другие
3. В разделе уведомлений выбрать, как именно вы хотите получать уведомления
4. Всё! Вы великолепны и теперь всегда будете первым узнавать о свежих материалах
8 282
Кажется, OTUS научился замедлять время
Иначе как объяснить, что на онлайн-буткемпе по Java вы освоите программу, на которую тратят полтора года, за 3 месяца? Там вы получите фундаментальные знания, полезные навыки и собственный проект в портфолио.
Принять участие можно до 28 февраля, успейте зарегистрироваться: https://tprg.ru/eWRj
Реклама ООО «Отус Онлайн-Образование»
8 282
Spring Cloud OpenFeign и авторизация
В статье я хочу показать, каким образом можно реализовать отправку запросов с авторизацией при использовании Spring Cloud OpenFeign клиента для работы с АПИ.
Читать: https://habr.com/ru/post/717610/?utm_campaign=717610
8 282
Sonatype BOM Doctor Evaluates and Helps Patch Java Software Bills of Materials
BOM Doctor is a free, GitHub-hosted tool created by Sonatype to scan software bills of materials (SBOMs) and identify vulnerabilities and legal issues.
By Sergio
Read: https://www.infoq.com/news/2023/02/sonatype-bom-doctor-tool/
8 282
2 Ways to Read a Text File in Java? BufferredReader and Scanner Examples
You can read a text file in Java by using either Files, BufferedReader or Scanner class. Both classes provide convenient methods to read a text file line by line e.g. Scanner provides nextLine() method and BufferedReader provides readLine() method. If you are reading a binary file, you can use FileInputStream. By the way, when you are reading text data, you also need to provide character encoding, if you don't then the platform's default character encoding is used. In Java IO, streams like InputStream are used to read bytes, and Readers like FileReader are used to read character data.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/06/2-ways-to-read-text-file-in-java-6.html
8 282
РАДИОТЕЛЕФОНЧИК НА СМАРТФОНЕ
Немало воды утекло со времени публикации цикла про стриминг видео на Андроид устройствах, но вот ручки добрались и до аудио потоков. Не то, чтобы это была какая-то более заковыристая тема про сравнению с видео, даже наоборот, сложно придумать что-то проще, ибо Audio API не менялось, дай бог памяти, с 2012 года, если не раньше. И не стоило бы, ради этого пилить короткий пост, если бы не зудящая мысля — а на какое расстояние и каким образом можно передать сей аудио поток, если мы будем использовать для этого только два смартфона без всякой мобильной связи и внешних точек доступа.
Если вам интересно узнать, что из этого получилось, то прошу проследовать под кат…
Читать: https://habr.com/ru/post/715978/?utm_campaign=715978
8 282
Java-сертификация: как мы заняли место ушедшего из РФ Oracle
Привет, Хабр! Oracle ушел, а сертифицироваться Java-разработчикам где-то нужно. Мы с партнерами решили занять освободившуюся нишу, и у нас это получилось. В этой статье расскажем о том, как мы создали аналог сертификации для джавистов, докрутили концепцию, а также дадим рекомендации, как подготовиться к тестированию, и поделимся полезными материалами.
Под катом много интересного и полезного. П
Читать: https://habr.com/ru/post/717348/?utm_campaign=717348
8 282
Project Valhalla: A look inside Java’s epic refactor
Read: https://www.infoworld.com/article/3687670/project-valhalla-a-look-inside-javas-epic-refactor.html#tk.rss_java
8 282
GitHub Copilot update includes security vulnerability filtering
Read: https://www.infoworld.com/article/3688269/github-copilot-update-includes-security-vulnerability-filtering.html#tk.rss_java
8 282
Difference between Spring Boot vs Spring Cloud in Java
Hello guys, if you are wondering, what is difference between Spring Boot and Spring Cloud then you re not alone. Many Java developer are not familiar with various spring boot projects like Spring Security, Spring Data JPA, Spring Batch, Spring Boot, Spring Cloud etc and this lack of knowledge prevent them from taking full advantage of Spring Framework. In last article, I have explained difference between Spring framework and Spring Boot and in this article we are going to discuss the difference between Spring Boot and Spring Cloud. Before we dive into the difference between the two terms. Let us take a look at different terms like Spring, Spring Boot, and Spring Cloud.
Java Interview questions and tutorials
Read: http://www.java67.com/2023/02/difference-spring-boot-vs-spring-cloud.html
8 282
How to do Inter process communication in Java? Example Tutorial
Hello guys, in the past, I have shown you how to do inter-thread communication in Java using wait-notify, and today, I will teach you how to dointer-process communication in Java. There are many ways to do inter-process communication in Java, you can use Sockets, both TCP and UDP, you can use RMI (Remote Method Invocation), you can use web services, or you can use memory-mapped file. The socket is the most common way of achieving inter-process communication if two processes are in two different hosts and connected via a network. RMI and WebService can also be used for similar purposes, but the last one, inter-process communication using memory-mapped files, is particularly useful if you are communicating with other processes in the same host, sharing the same memory and file system.
Java Interview questions and tutorials
Read: http://www.java67.com/2020/05/how-to-do-inter-process-communication-in-java.html
8 282
Why wait() and notify() method should be called inside a loop in Java? Example
Hello Java programmers, if you have used the wait() and notify() method in Java then you know that the standard idiom of calling the wait() method uses a loop, but have you ever thought why? This is even advised by none other than Joshua Bloch, a Java guru and author of the popular Effective Java book, a must-read for any Java programmer. When I first started using this method, I was puzzled why not just use the if blockbecause ultimately we are testing for a condition and then either waiting or going for further processing. An if block is more readable for the testing condition than a while loop like for the classic producer-consumer problem, the waiting condition for producer thread could be written as :
Java Interview questions and tutorials
Read: http://www.java67.com/2019/05/why-wait-and-notify-method-should-be-called-in-loop-not-if-block.html
8 282
Java CyclicBarrier Example for Beginners [Multithreading Tutorial]
This is the second part of my concurrency tutorial, in the first part, you have learned how to use CountDownLatch and in this part, you will learn how to use CyclicBarrier class in Java. CyclicBarrier is another concurrency utility introduced in Java 5 which is used when a number of threads (also known as parties) want to wait for each other at a common point, also known as the barrier before starting processing again. It's similar to the CountDownLatch but instead of calling countDown() each thread calls await() and when the last thread calls await() which signals that it has reached the barrier, all threads started processing again, also known as a barrier is broken.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/06/how-to-use-cyclicbarrier-in-java.html
8 282
Difference between wait and sleep in Java Thread? Example
Wait vs sleep in Java
Differences between wait and sleep methods in Java multi-threading is one of the very old questions asked in Java interviews. Though both wait and sleep put the thread on waiting for state, they are completely different in terms of behavior and use cases. Thread.sleep(long millis) is meant for introducing pause, releasing CPU, and giving another thread an opportunity to execute while wait is used for inter-thread communication in Java. These methods are defined in java.lang.Object class and available to every object in Java. It is based upon object lock, if you remember every object in Java has an implicit lock, also known as a monitor.
Java Interview questions and tutorials
Read: http://www.java67.com/2012/08/what-are-difference-between-wait-and.html
8 282
Spring Boot. Настройка профилирования времени выполнения
В процессе работы над одной из задач возникла необходимость промониторить время исполнения отдельных участков кода одного из микросервисов для того, чтобы отловить узкие места и попытаться эту ситуацию исправить.
Т.к. речь шла о сервисе, который был написан довольно давно, и в него многие месяцы не вносились изменения, повинуясь принципу “работает - не трогай”, я решил постараться сделать это, не прикасаясь к самому коду сервиса.
Читать: https://habr.com/ru/post/717114/?utm_campaign=717114
8 282
Создание мобильного приложения для рисования на Android Studio
Java, Android Studio и приложение для рисования, сделанное на них для самых "маленьких".
Читать: https://habr.com/ru/post/717102/?utm_campaign=717102
8 282
Wrike Lock: как мы разработали механизм шифрования данных в продукте
Привет! Меня зовут Даниил Гранкин, я разработчик внутреннего бэкенд-юнита в Wrike. В этой статье я поделюсь техническими подробностями разработки Wrike Lock — основного механизма шифрования данных в нашем продукте. А также расскажу, для чего мы используем Encryption as a Service (EaaS) и какие проблемы решаем с его помощью. Эта статья будет полезна, если вы ищете способы дистрибуции ключей шифрования, но готовые решения вам не подходят.
Читать: https://habr.com/ru/post/716878/?utm_campaign=716878
