Чашечка Java
Kanalga Telegram’da o‘tish
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
Ko'proq ko'rsatish8 551
Obunachilar
+524 soatlar
-87 kunlar
-2730 kunlar
Postlar arxiv
8 551
Java News Roundup: Spring Cloud, Liberica NIK, Open Liberty, Micronaut, JHipster, Apache ShenYu
This week's Java roundup for August 1st, 2022, features news from JDK 19, JDK 20, Spring point and milestone releases, Liberica NIK 22.2.0 and 21.3.3, Open Liberty 22.0.0.8 and 22.0.0.9-beta, Micronaut 3.6.0, WildFly 27 Alpha4, Hibernate ORM 6.1.2, Hibernate Validator 6.2.4, 7.0.5 and 8.0.0.CR2, Hibernate Search 6.1.6, JHipster 7.9.2, 7.9.1 and 7.9.0, JBang 0.96.4 and Apache ShenYu.
By Michael Redlich
Read: https://www.infoq.com/news/2022/08/java-news-roundup-aug01-2022/
8 551
Spring Test Containers как бины
TestContainers это отличный инструмент, позволяющий тестировать свой код в prod-like окружении.
Однако трудности возникают когда появляется потребность провести сложное интеграционное тестирование используя несколько таких контейнеров, например, базы + очереди, нескольких очередей и т.д.
В этой статье мы разберём как подружить несколько контейнеров, особенно когда один контейнер использует такие настройки, которые генерирует второй контейнер во время своего старта.
Достигнем этого при помощи кастомизации тестового контекста + всеми любимого BeanFactoryBostProcessor'а.
Читать: https://habr.com/ru/post/681232/?utm_campaign=681232
8 551
Top Java Blogs Weekly: Best of 33/2022
Best of Top Java Blogs, year 2022, week 33
Read: https://www.topjavablogs.com/news/best-of-33-2022
8 551
How to Fix java.lang.ArrayIndexOutOfBoundsException in Java [Solution]
The ArrayIndexOutOfBoundsException, also known as java.lang.ArrayIndexOutOfBoundsExcepiton is one of the most common errors in Java programs. It occurs when a Java program tries to access an invalid index like. an index that is not positive or greater than the length of an array or ArrayList. For example, if you have an array of String like String[] name = {"abc"} then trying to access name[1] will give java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 error because index 1 is invalid here. Why? because the index in the Java array starts with zero rather than 1, hence in an array of just one element the only valid index is index zero.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/07/common-reasons-of-javalangarrayindexoutofbounds-exception-java.html
8 551
Дюк, вынеси мусор! — 5. Epsilon GC
Сборщики мусора из OpenJDK, которые мы успели рассмотреть к этому моменту (Serial и Parallel, CMS и G1, ZGC), были нацелены на как можно более быструю и эффективную сборку мусора, для чего использовали техники различной степени сложности и изобретательности. Это вполне ожидаемо, ведь исходя из названия, борьба с мусором — это их основная обязанность.
Но сегодня у нас на рассмотрении сборщик, который выбивается из общей картины. Его разбор будет недолгим, но полезным, так как позволит взглянуть на один не рассматривавшийся до этого аспект работы сборщиков. Давайте немного отдохнем от сложных технических трюков и разберемся с Epsilon GC — самым простым из входящих в состав OpenJDK сборщиков.
Отдохнуть, разобраться
Читать: https://habr.com/ru/post/681116/?utm_campaign=681116
8 551
10 Examples of ls command in Linux
Hey there, if you are wondering how to check what inside a directory or just wondering what is ls command in Linux and how to use it to list files then you have come to the right place. Earlier, I have shared examples of df command, du command, find command, grep command, tar command and chmod command and in today’s article we shall be looking at 10 different examples of ls command in Linux. But before then you would need the meaning of ls and what it is being used for. The goal of this article is to get you comfortable with different things you could do with the ls command and this articles would show you in details how to use it, when to use it and it’s benefits. Let’s go
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/10-examples-of-ls-command-in-linux.html
8 551
What is Tomcat? The original Java servlet container
Read: https://www.infoworld.com/article/3510460/what-is-apache-tomcat-the-original-java-servlet-container.html#tk.rss_java
8 551
Пишем тесты производительности под Webflux
Добрый день! Меня зовут Александр Леонов, я руководитель группы разработки одной из распределённых команд Usetech. Сегодня я хочу рассказать вам о том, как написать карманный тест производительности на неблокирующий код Webflux. Статья рассчитана на разработчиков, которые разрабатывают API или выполняют оптимизационный рефакторинг медленного кода. Итак, начнём.
Читать: https://habr.com/ru/post/680948/?utm_campaign=680948
8 551
Top 25 Java Error and Exception Interview Questions Answers
1) The difference between checked and Unchecked Exceptions in Java?
For checked exceptions, the compiler ensures that they are either handled using try-catch, try-finally, or try-catch-finally block or thrown away. If a method, which throws a checked exception like IOException, and doesn't handle them or doesn't declare them in the throws class of the method, a compile-time error will occur. On the other hand, the compiler doesn't do similar checks for an unchecked exception, that's why it is known as un-checked. These are also called runtime exceptions because they extend java.lang.RuntimeException.
Java Interview questions and tutorials
Read: http://www.java67.com/2019/06/top-25-java-exception-interview-questions-answers.html
8 551
[Solved] java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener in Java and Spring
Problem :You are getting java.lang.ClassNotFoundException : org.Springframework.Web.
Context.ContextLoaderListener in your Spring-based Java Web application.
Cause: This error comes when you are using the Spring MVC framework in your Java Web application and configured org.springframework.web.context.ContextLoaderListener as a listener in your deployment descriptor also known as web.xml, but the JAR which contains this class is not available in the web application's CLASSPATH.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/06/org.Springframework.Web.Context.ContextLoaderListener.html
8 551
10 Reasons of java.lang.NumberFormatException in Java - Solution
The NumberFormatExceptionis one of the most common errors in Java applications, along with NullPointerException. This error comes when you try to convert a String into numeric data types e.g., int, float, double, long, short, char, or byte. The data type conversion methods like Integer.parseInt(), Float.parseFloat(), Double.parseDoulbe(), and Long.parseLong() throws NumberFormatException to signal that input String is not valid numeric value.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/10/10-reasons-of-javalangnumberformatexception-in-java-solution.html
8 551
3 ways to solve Eclipse - main class not found error
Like many Java programmers who get "Error: Could not find or load main class Main" while running the Java program in Eclipse, I was also getting the same problem recently. The "Error: Could not find or load main class"was rendered me puzzled even after my 10+ years of experience with Java errors and exceptions. Whenever I run my Java application either by Run configurations or right-click and run as a Java program, I get an annoying popup complaining about "could not find or load the main class, the program will exit".
Java Interview questions and tutorials
Read: http://www.java67.com/2016/09/3-ways-to-solve-eclipse-main-class-not-found-error-java.html
8 551
Can You declare Constructor inside Servlet Class in Java? Answer
Yes, Servlet can have Constructor, it's perfectly legal but it's not the right way to initializeyour Servlet. You should use the init() method provided by the Servlet interface to initialize the Servlet. If you remember, Servlet's are special in the sense that they are instantiated by the container and managed by the container. A servlet container like Tomcat creates a pool of multiple Servlets to serve multiple clients at the same time.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/02/can-you-declare-constructor-inside.html
8 551
Как красиво избавиться от switch-case посредством перечисления
Привет, хабр! Применение switch-case в коде - давняя тема холиваров на форумах на предмет чистоты кода. Лично я склоняюсь к простому мнению: инструмент необходимо использовать по назначению.
Сегодня хотелось бы рассмотреть несколько простых кейсов, где switch-case является не лучшим выбором и предложить красивое и удобное решение проблемы.
Читать: https://habr.com/ru/post/680940/?utm_campaign=680940
8 551
10 Examples of ps command in Linux
In Today's article, You will be learning about the "ps" command in Linux and our objectives are:
To know what Ps stands for, how it works with numerous options, and provide different examples and the usage of it.
PS stands for processes status. Basically used to list the processes that are running at the moment. As we all know that when a task needs to be implemented it must follow or have a process. There are different options you could use with it and this gives you a different result.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/10-examples-of-ps-command-in-linux.html
8 551
How to fix "variable might not have been initialized" error in Java? Example
This error occurs when you are trying to use a local variable without initializing it. You won't get this error if you use an uninitialized class or instance variable because they are initialized with their default value like Reference types are initialized with null and integer types are initialized with zero, but if you try to use an uninitialized local variable in Java, you will get this error. This is because Java has the rule to initialize the local variable before accessingor using them and this is checked at compile time. If the compiler believes that a local variable might not have been initialized before the next statement which is using it, you get this error. You will not get this error if you just declare the local variable but will not use it.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/07/how-to-fix-variable-might-not-have-been-initialized-error-in-java.html
8 551
[Solved] Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg'
Hello guys, if you are getting "Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg'" error or just Error: could not open 'jvm.cfg and wondering what to do and how to solve this error then you have come to the right place. I will show you how I solved this error and how you can use my tips to solve your error as well. A couple of weeks back I updated my laptop to Windows 10 but after trying for one day, I reverted back to Windows 8.1. Everything was alright until I open Eclipse, which was throwing "Error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg', as soon as I launch it. It was quite bizarre because everything was fine earlier.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/10/error-could-not-open-java-jmv-cfg-lib-eclipse.html
8 551
Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger in Java [Solution]
Problem:You are getting Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Loggererror in your Java application, which is using Log4j Logger either directly or indirectly via some popular Java framework like Spring, Struts or Hibernate.
Cause : Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger error indicates that JVM is not able to found org.apache.log4j.Logger class in your application's CLASSPATH. The simplest reason for this error is the missing log4j.jarfile. Since org.apache.log4j.Logger class belongs to this JAR file, if it's not available at run-time then your program will fail.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/08/caused-by-javalangnoclassdeffounderror-org-apache-log4j-Logger.html
8 551
How to Avoid/Fix ConcurrentModificationException while looping over ArrayList in Java [Example]
Apart from the NullPointerException and ClassNotFoundException, ConcurrentModificationExceptionis another nightmare for Java developers. What makes this error tricky is the word concurrent, which always mislead Java programmers that this exception is coming because multiple threads are trying to modify the collection at the same time. Then begins the hunting and debugging, they spent countless hours to find the code which has the probability of concurrent modification. While in reality, ConcurrentModficationException can also come in a single-threaded environment.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/10/how-to-solve-concurrentmodificationexception-in-java-arraylist.html
8 551
[Solved] Exception in thread "main" java.lang.IllegalStateException during Iterator.remove() in Java
Hello guys, if you are wondering how to deal with java.lang.IllegalStateException while trying to remove elements from ArrayList in Java then you have come to the right place. In this article, I am going to share how I solved this problem and how you can do the same. I was writing a sample program to demonstrate how to remove elements from the list while iterating over it by using the Iterator.remove() method. Unfortunately, I was getting the following error, right at the place where I was calling the Iterator.remove() method :
Java Interview questions and tutorials
Read: http://www.java67.com/2016/01/exception-in-thread-main-java.lang.IllegalStateException-Iterator-remove.html
Endi mavjud! Telegram Tadqiqoti 2025 — yilning asosiy insaytlari 
