ru
Feedback
Чашечка Java

Чашечка Java

Открыть в Telegram

Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels

Больше
8 558
Подписчики
Нет данных24 часа
-147 дней
-1330 день
Архив постов
How to Configure CORS in a Spring Boot + Spring Security application Cross-Origin Resource Sharing (CORS) is an essential mec
How to Configure CORS in a Spring Boot + Spring Security application Cross-Origin Resource Sharing (CORS) is an essential mechanism for controlling access to web resources across different domains. When developing a Spring Boot application with Spring Security, it is crucial to configure CORS properly to allow or restrict cross-origin requests based on security requirements. In this article, we will explore how to configure CORS in a Spring Boot + Spring Security application, ensuring secure and controlled access to resources. We will provide step-by-step instructions and relevant code examples to help you implement CORS effectively. Java Interview questions and tutorials Read: http://www.java67.com/2023/07/how-to-configure-cors-in-spring-boot.html

What is the actual Use of interface in Java? An interface in Java has remained a complex topic for many beginners to understa
What is the actual Use of interface in Java? An interface in Java has remained a complex topic for many beginners to understand. The first thing which puzzles many programmers is the fact that you cannot define any method inside interface, it a just declaration. By rule, all method inside interface must be abstract (Well, this rule is changing in Java 8 to allow lambda expressions, now interface can have one non-abstract method, also known as a default method). So, if you can't define anything, Why we need an interface? what's the use of an interface, if we are anyway going to write a class and override them to provide behaviour, Can't we declare those methods inside the class itself without using interface etc. Well, if you are thinking in terms of behaviour then you are really missing the point of interface. Java Interview questions and tutorials Read: http://www.java67.com/2014/02/what-is-actual-use-of-interface-in-java.html

How to use Modulo , Modulus, or Remainder Operator in Java? [Example] Modulo Operator is one of the fundamental operators in
How to use Modulo , Modulus, or Remainder Operator in Java? [Example] Modulo Operator is one of the fundamental operators in Java. It's a binary operator i.e. it requires two operands. In a division operation, the remainder is returned by using the modulo operator. It is denoted by the % (percentage) sign. For example, 5%2 will return 1 because if you divide 5 with 2, the remainder will be 1. For a programmer it's very important to know how to use this operator, they are very important to build logic. For example, in many cases like reversing a number or checking if a number is a palindrome, you can use the modulus operator with 10 to get the last digit, for example, 101%10 will return 1 or 1234%10 will return 4, the last digit. Java Interview questions and tutorials Read: http://www.java67.com/2014/11/modulo-or-remainder-operator-in-java.html

How to Print Array with elements in Java? [Solution + Example] You cannot print array elements directly in Java, you need to
How to Print Array with elements in Java? [Solution + Example] You cannot print array elements directly in Java, you need to use Arrays.toString() or Arrays.deepToString() to print array elements. Use toString() if you want to print a one-dimensional array and use deepToString() method if you want to print a two-dimensional array. Have you tried printing arrays in Java before? What did you do? just passed an array to println() method and expecting it prints its elements? Me too, but surprisingly array despite being Object and providing a length field, doesn't seem overriding the toString() method from java.lang.Object class. All it prints is type@somenumber. This is not at all useful for anyone who is interested in seeing whether an array is empty or not, if not then what elements it has etc. Java Interview questions and tutorials Read: http://www.java67.com/2014/03/how-to-print-array-in-java-example-tutorial.html

How to Remove Duplicates from ArrayList in Java [Example] ArrayList is the most popular implementation of the List interface
How to Remove Duplicates from ArrayList in Java [Example] ArrayList is the most popular implementation of the List interface from Java's Collection framework, but it allows duplicates. Though there is another collection called Set which is primarily designed to store unique elements, there are situations when you receive a List like ArrayList in your code and you need to ensure that it doesn't contain any duplicate before processing. Since with ArrayList you cannot guarantee uniqueness, there is no other choice but to remove repeated elements from ArrayList. Java Interview questions and tutorials Read: http://www.java67.com/2015/03/how-to-remove-duplicates-from-arraylist.html

Whirl Platform — разработка длинной в 10 лет Поведаю историю развития одного проекта длительностью в более чем 10 лет. На основе проекта, речь о котором пойдет ниже, случилось мое становление как разработчика/архитектора. История более биографическая, чем техническая, с вкраплением мыслей о разработке в целом и небольшим обзором проекта который развивает наша команда. Если вы ждете техно-жесткача с фреймворками, конфигами и кусками кода, то дальше читать не надо - такого не будет. Продолжив вы узнаете про чужой опыт развития долгоживущего продукта, узнаете о еще одном отечественном open source проекте и просто увидите картинки с UI конструктором приложений. Читать: https://habr.com/ru/articles/747876/?utm_campaign=747876

Функциональное тестирование в SpringBoot Всем привет, в прошлый раз мы говорили про юнит тесты с MockMVC, сегодня мы напишем функциональные тесты для того же самого кода. Начнем. Из пререквизитов у нас есть код приложения BookController.java. Читать: https://habr.com/ru/companies/otus/articles/747852/?utm_campaign=747852

Модернизация приложений и обеспечение надёжности сайтов (SRE) Часто приходится говорить с клиентами и партнёрами о целостной модернизации приложений. В контексте модернизации приложений наиболее востребованы такие аспекты как обеспечение надёжности приложений, упрощение проектирования и как можно более безотказная эксплуатация. Поэтому среди руководящих представителей инженерного звена всё популярнее становится практика обеспечения надёжности (SRE), де-факто превратившаяся в эксплуатационный стандарт для крупных корпораций. В этом посте я хотел бы изложить простую точку зрения на то, как сочетать SRE и модернизацию enterprise-приложений. Расскажу о том, как коррелируют две эти практики. Читать: https://habr.com/ru/companies/piter/articles/747850/?utm_campaign=747850

Поиск похожих строк (LCS + Расстояние Левенштейна) Рассмотрим алгоритмическую задачу: Least common subsequence + расстояние Левенштейна. Будем учитывать, что: Пользователь мог поменять слова местами. Пользователь мог ввести только часть (подпоследовательность) строки, которую хотел найти в наборе. Пользователь мог допустить опечатки: пропуск букв, написание лишних букв, замена букв на другие. Читать: https://habr.com/ru/articles/747822/?utm_campaign=747822

Потоковая обработка данных с помощью Kafka Streams: архитектура и ключевые концепции При реализации потоковой обработки и анализа данных может возникнуть необходимость агрегирования записей для объединения нескольких независимых поток данных или обогащения какой-либо модели данных. Для этой цели может использоваться Kafka Streams, которая позволяет выполнять обработку данных в режиме реального времени. В этой статье мы рассмотрим основные компоненты Kafka Streams и теоретические аспекты их использования. Мы будем использовать последние версии технологий, доступных на сегодня: Kafka 3.4.0 и Java 17 в качестве языка программированию. Для снижения входного порога мы будем использовать только нативные возможности Kafka и Kafka Streams, и не будем рассматривать решения с использованием различных фреймворков вроде Spring. Читать: https://habr.com/ru/articles/747658/?utm_campaign=747658

How to Sort a List into Ascending and Descending Order in Java? Examples ArrayList, Set Sorting in Ascending – Descending Ord
How to Sort a List into Ascending and Descending Order in Java? Examples ArrayList, Set Sorting in Ascending – Descending Order Java Sorting List, Set, and ArrayList in Java in ascending and descending order is very easy, You just need to know the correct API method to do that. For example Collections.sort()  method will sort the collection passed to it,  doesn't return anything just sort the collection itself. From Java 8 onwards you can also useList.sort()method to sort a List in ascending or descending order directly without using Collections.sort() method. If you like to use Stream API, it also provide a sort() method to sort elements inside Stream. You can also use that to sort any List. For example, you can first convert a List to Stream and then sort the Stream and collect the result into another List. Java Interview questions and tutorials Read: http://www.java67.com/2012/07/sort-list-ascending-descending-order-set-arraylist.html

How to convert long to String in Java? Example There are three main ways to convert a long value to a String in Java e.g. by
How to convert long to String in Java? Example There are three main ways to convert a long value to a String in Java e.g. by using Long.toString(long value) method, by using String.valueOf(long), and by concatenating with an empty String. You can use any of these methods to convert a long data type into a String object. It's not very different from how you convert an int to String in Java. The same method applies here as well. String concatenation seems the easiest way of converting a long variable to a String, but others are also convenient. Java Interview questions and tutorials Read: http://www.java67.com/2015/07/how-to-convert-long-value-to-string-in-java-example.html

Difference between RuntimeException and checked Exception in Java RuntimeException vs Checked Exception in Java Java Exceptio
Difference between RuntimeException and checked Exception in Java RuntimeException vs Checked Exception in Java Java Exceptions are divided into two categories RuntimeException also known as unchecked Exception and checked Exception. Main difference between RuntimeException and checked Exceptionis that It is mandatory to provide try-catch or try finally block to handle checked Exception and failure to do so will result in a compile-time error, while in the case of RuntimeException this is not mandatory. The difference between checked and unchecked exception is one of the a most popular question on Java interview for 2 to years experienced developer especially related to Exception concepts. Java Interview questions and tutorials Read: http://www.java67.com/2012/12/difference-between-runtimeexception-and-checked-exception.html

Vaadin 24.1.0: Enhancing Web Application Development with New Features and Optimizations Vaadin, the open-source platform for
Vaadin 24.1.0: Enhancing Web Application Development with New Features and Optimizations Vaadin, the open-source platform for building business-oriented single-page web applications, has announced the release of Vaadin 24.1.0. This latest version brings a host of new features and improvements, further enhancing the platform's capabilities and providing developers with more tools to create robust, high-performing web applications. By A N M Bazlur Rahman Read: https://www.infoq.com/news/2023/07/vaadin-release-24/

Прожарка java.lang.String Давайте абьюзить баг в java.lang.String, который позволит делать очень странные строки. Мы сделаем "Hello World", который не начинается с "Hello" и покажем, что не все пустые строки равны между собой. Научимся прожаривать строки в чужих классах. Вкуснотища. . Читать: https://habr.com/ru/companies/bar/articles/747528/?utm_campaign=747528