Чашечка Java
Open in Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
Show more8 551
Subscribers
-124 hours
-207 days
-2430 days
Posts Archive
8 551
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 551
РАДИОТЕЛЕФОНЧИК НА СМАРТФОНЕ
Немало воды утекло со времени публикации цикла про стриминг видео на Андроид устройствах, но вот ручки добрались и до аудио потоков. Не то, чтобы это была какая-то более заковыристая тема про сравнению с видео, даже наоборот, сложно придумать что-то проще, ибо Audio API не менялось, дай бог памяти, с 2012 года, если не раньше. И не стоило бы, ради этого пилить короткий пост, если бы не зудящая мысля — а на какое расстояние и каким образом можно передать сей аудио поток, если мы будем использовать для этого только два смартфона без всякой мобильной связи и внешних точек доступа.
Если вам интересно узнать, что из этого получилось, то прошу проследовать под кат…
Читать: https://habr.com/ru/post/715978/?utm_campaign=715978
8 551
Java-сертификация: как мы заняли место ушедшего из РФ Oracle
Привет, Хабр! Oracle ушел, а сертифицироваться Java-разработчикам где-то нужно. Мы с партнерами решили занять освободившуюся нишу, и у нас это получилось. В этой статье расскажем о том, как мы создали аналог сертификации для джавистов, докрутили концепцию, а также дадим рекомендации, как подготовиться к тестированию, и поделимся полезными материалами.
Под катом много интересного и полезного. П
Читать: https://habr.com/ru/post/717348/?utm_campaign=717348
8 551
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 551
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 551
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 551
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 551
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 551
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 551
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 551
Spring Boot. Настройка профилирования времени выполнения
В процессе работы над одной из задач возникла необходимость промониторить время исполнения отдельных участков кода одного из микросервисов для того, чтобы отловить узкие места и попытаться эту ситуацию исправить.
Т.к. речь шла о сервисе, который был написан довольно давно, и в него многие месяцы не вносились изменения, повинуясь принципу “работает - не трогай”, я решил постараться сделать это, не прикасаясь к самому коду сервиса.
Читать: https://habr.com/ru/post/717114/?utm_campaign=717114
8 551
Создание мобильного приложения для рисования на Android Studio
Java, Android Studio и приложение для рисования, сделанное на них для самых "маленьких".
Читать: https://habr.com/ru/post/717102/?utm_campaign=717102
8 551
Wrike Lock: как мы разработали механизм шифрования данных в продукте
Привет! Меня зовут Даниил Гранкин, я разработчик внутреннего бэкенд-юнита в Wrike. В этой статье я поделюсь техническими подробностями разработки Wrike Lock — основного механизма шифрования данных в нашем продукте. А также расскажу, для чего мы используем Encryption as a Service (EaaS) и какие проблемы решаем с его помощью. Эта статья будет полезна, если вы ищете способы дистрибуции ключей шифрования, но готовые решения вам не подходят.
Читать: https://habr.com/ru/post/716878/?utm_campaign=716878
8 551
Faster Startup Time and Lower Memory Usage: New CRT HTTP Client in AWS SDK for Java
AWS recently announced the general availability of the Common Runtime (CRT) HTTP Client in the AWS SDK for Java 2.x. The new asynchronous client provides faster SDK startup time and a smaller memory footprint improving Lambda serverless workloads.
By Renato Losio
Read: https://www.infoq.com/news/2023/02/aws-sdk-java-crt-client/
8 551
Android 14 Brings Partial Support for OpenJDK 17, Improved Privacy and Security, and More
Google has announced the first Android 14 beta, which provides support for over 300 OpenJDK 17 classes. Additionally, it implements a number of features aimed to keep malicious apps at bay and extends support for foldable form factors, battery usage optimization, and more.
By Sergio De Simone
Read: https://www.infoq.com/news/2023/02/android-14-preview/
8 551
Docker, Maven lead the way in packages
Read: https://www.infoworld.com/article/3687747/docker-maven-lead-the-way-in-packages.html#tk.rss_java
8 551
How to send Email in Java using Spring Framework? JavaMailSenderImpl Example Tutorial
Hello guys, if you want to send emails from your Java application and looking for a Java + Spring Framework tutorial to send emails then you have come to the right place. Earlier, I have shared the free spring framework online courses, and today, I am going to share how to send Emails in the Java application using Spring Framework and JavaMailSenderImpl class which makes it really easy to send emails from Java application. Email is one of the essential function of any enterprise Java application. Your application will need Email functionality to send reminders, bills, payments, confirmations, passwords, alerts, and several other kinds of system notifications.
Java Interview questions and tutorials
Read: http://www.java67.com/2019/10/how-to-send-email-in-java-using-spring.html
8 551
Java News Roundup: JDK 20 RC1, Open Liberty, Micronaut, Helidon, Hibernate, Groovy, Grails
This week's Java roundup for February 6th, 2023 features news from OpenJDK, JDK 20, JDK 21, Open Liberty 23.0.0.1 and 23.0.0.2-beta, Helidon 3.1.1, Quarkus 2.16.2 and 3.0.0.Alpha4, Micronaut 3.8.4, Hibernate ORM 6.2, 6.1.7 and 5.6.15, Grails 5.3.0, Apache Groovy 4.0.9 and 3.0.15, Apache Camel 3.20.2, Eclipse Vert.x 4.3.8, Gradle 8.0.0-RC5, Jarviz 0.2.0, Kotlin K2 compiler and Jfokus conference.
By Michael Redlich
Read: https://www.infoq.com/news/2023/02/java-news-roundup-feb06-2023/
8 551
Мессенджеры на работе — это не прокрастинация, или как мы сделали сервис для автотестирования. Часть 2
Это вторая часть статьи «Мессенджеры на работе — это не прокрастинация, или как мы сделали сервис для автотестирования». Как и обещали, в данной статье мы расскажем о том, как масштабировали наш сервис, как развивали функциональность автотестов и как в итоге вышли за рамки обычного репорт-бота.
Читать: https://habr.com/ru/post/716694/?utm_campaign=716694
8 551
How to ArrayList of Objects by Fields in Java? Custom and Reversed Order Sorting using Comparator Example
There are a lot of examples of Sorting ArrayList in Java on the internet, but most of them use either String or Integer objects to explain sorting, which is not enough, because in real-world you may have to sort a list of custom objectslike your domain or business objects like Employee, Book, Order, Trade, etc. In order to sort an ArrayList of custom or user-defined objects, you need two things, first a class to provide ordering and a method to provide sorting. If you know about ordering and sorting in Java then you know that the Comparable and Comparator class is used to provide the ordering for objects.
Java Interview questions and tutorials
Read: http://www.java67.com/2017/07/how-to-sort-arraylist-of-objects-using.html
Available now! Telegram Research 2025 — the year's key insights 
