Чашечка Java
前往频道在 Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
显示更多8 281
订阅者
-124 小时
-37 天
-7130 天
帖子存档
8 280
Java News Roundup: JReleaser 1.2, Spring Batch, PrimeFaces, Quarkus, JobRunr, Apache Beam
It was very quiet for Java news during the week of August 22nd, 2022 featuring news from JDK 19, JDK 20, Spring Batch 5.0.0-M5, Quarkus 2.11.3, JReleaser 1.2.0, PrimeFaces 12.0.0-M3, JobRunr 5.1.8, Apache Beam 2.14.0 and Apache Johnzon 1.2.19.
By Michael Redlich
Read: https://www.infoq.com/news/2022/08/java-news-roundup-aug22-2022/
8 280
Article: Java Champion James Ward on the State of Java and JVM Languages
James Ward is a Java Champion and Google’s Kotlin Product Manager. In a podcast, Ward agreed that “people are still trapped in the Java world” and called default mutability in Java the “trillion-dollar mistake”. In this interview, he speaks about the state of Java, JVM languages, mutability, and functional programming.
By Karsten Silz
Read: https://www.infoq.com/articles/james-ward-java-jvm-languages/
8 280
Presentation: Level Up Your Java Performance with TornadoVM
Juan Fumero overviews the TornadoVM project, a parallel programming framework, and a Virtual Machine for transparently offloading Java programs onto GPUs and FPGAs.
By Juan Fumero
Read: https://www.infoq.com/presentations/java-performance-tornadovm/
8 280
Difference between @Component, @Service, and @Repository Spring Annotations - Java
Hello guys if you are wondering what is the difference between @Component, @Service, and @Reposistory annotation in Spring Framework then you have come to the right place. In the past, I have shared 15 Spring Boot Interview Questions and 30 Spring MVC questions and in this article, I am going to answer the fundamental and popular Spring questions about @Component, @Service, and @Repository annotation, but before we go into differences, let's understand the similarity first. All three of them are used to make a Java class a Spring bean, something which is managed by Spring Framework.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/06/difference-between-component-service-repository-in-spring.html
8 280
Top Java Blogs Weekly: Best of 36/2022
Best of Top Java Blogs, year 2022, week 36
Read: https://www.topjavablogs.com/news/best-of-36-2022
8 280
@SpringBootTest integration test Example Java
When we talk about spring boot integration testing, we're talking about launching an application in ApplicationContext and performing tests. For integration testing, Spring Framework has a specific test module. It's referred to as a spring test. If we're going to utilize spring-boot, we'll need to use spring-boot-starter-test, which uses spring-test and other dependencies inside.
We'll look at how to perform integration tests for a Spring Boot application in this post.
First of all, let's understand what integration testing is and what to test as part of integration testing in Spring.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/springboottest-integration-test-example.html
8 280
How to use lsof command in Linux? Example Tutorial
Hello guys, If you want to learn how to use lsof command in Linux then you have come to the right place. In the last few article, I talk about find, grep, mailx, crontable and du command in Linux and in this article I am going to talk about another useful Linux command, the lsof command. The lsof command lists open files and that's why its named lsof. This command is very important for server side developer and IT support people who need to check which file is held by which process and find the deleted files which are hogging memory etc. It act as a useful debugging and troubleshooting tool in Linux.
Java Interview questions and tutorials
Read: http://www.java67.com/2020/07/10-examples-of-lsof-command-in-linux.html
8 280
How to Synchronize HashMap in Java? Collections.synchronizedMap() Example Tutorial
Hello guys, if you have used HashMap class in Java before than you will know that HashMap is not synchronized, which means you cannot use it on multi-threaded Java programs without external synchronization. In other words, if you share an instance of HashMap between multiple threads, where each of them is either adding, removing or updating entries then it's possible that HashMap may lose its structure and not behave as expected. In simple words, exposing HashMap to multiple threads can corrupt the Map and you may not able to retrieve the data you want. If you have read my earlier article about HashMap, you know that during re-sizing its possible that HashMap exposed to multiple threads, may end up in an infinite loop.
Java Interview questions and tutorials
Read: http://www.java67.com/2015/02/how-to-synchronize-hashmap-in-java-with.html
8 280
Difference between WeakHashMap , IdentityHashMap, and EnumMap in Java?
Hello guys, if you are wondering what is the difference between WeakHashMap, IdentityHashMap, and EnumMap in Java then you are at the right place. In last article, we have seen difference between HashMap, TreeMap, and LinkedHashMap in Java and in this article we will difference between WeakHashMap, EnumMap, and IdnetityHashMap in Java. Apart from popular implementation like HashMap and LinkedHashMap, java.util.Map also has some specialized implementation classes e.g. IdentifyHashMap which uses == instead of equals() method for comparing keys, WeakHashMap which uses WeakReference to wrap the key object and a key/value mapping is removed when the key is no longer referenced from elsewhere, and EnumMap where keys are Enum constants.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/09/difference-between-identityhashmap-weakhashmap-enummap-in-java.html
8 280
Практические примеры использования Stream API
Всем привет! Решил написать статью с практическими примерами использования Stream API. В данной статье не будет теории - только хардкор и практические примеры. Поехали!
В качестве "подопытного кролика" буду использовать проект, который можете найти здесь.
Для тестирования буду использовать Postman.
В проекте есть три сущности с которыми мы будем работать: Client, Product и Booking. Связи между ними можно посмотреть на следующей картинке.
Читать: https://habr.com/ru/post/684912/?utm_campaign=684912
8 280
How to Execute threads in order in Java - Join Example
Sometime we need to execute multiple threads in a particular order e.g. if we have three threads T1, T2 and T3 and we want to execute them in a sequence such that thread 2 starts only when first thread finishes it job and T3 starts after T2, but with multithreading in Java there is no guarantee. Threads are scheduled and allocated CPU by thread scheduler which you cannot control but you can impose such ordering by using Thread.join() method. When you start a thread its not guaranteed that which thread will start first and whether the thread started first will finish first, if your application's logic depends upon a sequence its better to do all those operation on single thread because if all code is confined to one thread it will execute in order they were written provided some JIT optimization.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/how-to-execute-threads-in-order-in-java.html
8 280
How to sort a Map by keys in Java? TreeMap and HashMap Example
So you have a Map in your Java program and you want to process its data in sorted order. Since Map doesn't guarantee any order for its keys and values, you always end up with unsorted keys and Map. If you really need a sorted Map then think about using the TreeMap, which keeps all keys in sorted order. This could be either natural order of keys (defined by Comparable) or custom order (defined by Comparator), which you can provide while creating an instance of TreeMap. If you don't have your data in a sorted Map then the only option that remain for you is to get the keys and values, sort them and then process your Map in that order.
Java Interview questions and tutorials
Read: http://www.java67.com/2014/04/2-ways-to-sort-hashmap-in-java-example.html
8 280
Java HashMap keySet() , entrySet and values() Example - Tutorial
The java.util.Map interface provides three methods keySet(), entrySet() and values() to retrieve all keys, entries (a key-value pair), and values. Since these methods directly come from the Map interface, you can use them with any of the Map implementation classes e.g. HashMap, TreeMap, LinkedHashMap, Hashtable, ConcurrentHashMap, and even with specialized Map implementations like EnumMap, WeakHashMap, and IdentityHashMap. In order to become a good Java developer, it's important to understand and remember key classes of Java API like Java's Collection framework.
Java Interview questions and tutorials
Read: http://www.java67.com/2016/05/keyset-vs-entryset-vs-values-in-java-map-example.html
8 280
10 Examples of HashMap in Java - Programming Tutorial
The HashMapin Java is one of the most popular Collection classes among Java programmers. After my article on How HashMap works in Java, which describes the theory part of Java HashMap and becomes hugely popular among Java programmers, I thought to share how to use HashMap in Java with essential and fundamental HashMap examples, but couldn't do that earlier and it was slipped but today we are here with all the HashMap examples about getting values to checking if a key exists in Map, I am going to share everything a Java developer should know about HashMap. The HashMap is a data structure, based on hashing, which allows you to store an object as a key-value pair, an advantage of using HashMap is that you can retrieve objects on constant time i.e. O(1) if you know the key.
Java Interview questions and tutorials
Read: http://www.java67.com/2013/02/10-examples-of-hashmap-in-java-programming-tutorial.html
8 280
Введение в DbChange JUnit расширение
Простой и декларативный способ выполнять SQL запросы в JUnit тестах.
Читать: https://habr.com/ru/post/684692/?utm_campaign=684692
8 280
Почему после 25+ лет в профессии и десятка-другого языков я бы рекомендовал начинать с Java
Когда-то в мире был только Си. Или Бэйсик. Или Паскаль. Это если не считать ассемблер для КР580ВМ. И хотя в книгах можно было найти упоминание ещё и о Фортране, но уже тогда, вместе с упоминаниями, были и предостережения о не самом удачном выборе, если бы вам вдруг захотелось писать на этом языке. Так выглядел мир глазами школьника из СССР.
Начинать тогда предлагалось с Бэйсика. Журнал "Наука и жизнь" так прямо и указывал. А заодно предлагал серию статей, заменявших вводный курс программирования начинающим хакерам. Была, конечно, ещё и "Техника молодёжи" с её занимательно составленным введением в программирование, но только на программируемом калькуляторе. Сегодня, наверное, сложно себе представить, как можно было увлечься каким-то программируемым калькулятором, ведь все с детства привыкли к айфонам с андроидами, но в те стародавние времена, когда книг с фантастикой в местной библиотеке было мало, школьники как некое чудо воспринимали коротенькие фантастические рассказы в "Технике молодёжи", сопровождавшиеся показом, как можно самостоятельно рассчитать все манёвры главного героя около Луны и летавшей где-то неподалёку окололунной станции.
Так мы входили в АйТи. Или в IT? Ну тогда мы даже аббревиатуры такой не знали. А потом пришлось взрослеть.
Читать: https://habr.com/ru/post/684786/?utm_campaign=684786
8 280
Article: How To Speed Up Large Collections Processing in Java
A review on Java performance for many objects using Java Collections or alternative collections, with the impact of serial vs. parallel streams. For some streaming data sets, parallel processing can be slower than the default.
By Nahla Davies
Read: https://www.infoq.com/articles/java-collections-streams/
8 280
Java on Visual Studio Code Update – August 2022
Read: https://devblogs.microsoft.com/java/java-on-visual-studio-code-update-august-2022/
8 280
4 канала для тех, кто хочет прокачаться в определённом направлении программирования:
— по анализу данных: @big_data_analysis
— по DevOps: @devo_pes
— по веб-разработке: @tproger_web
— по мобильной разработке: @mobi_dev
8 280
10 examples of crontab commands in Linux
In Today's article, You shall be learning the 10 examples of crontab commands in Linux. The Objectives are : what is the meaning of cron, what it is used for and when is it used in Linux.
Now, What is ‘crontab’ Command<o:p
Crontab command is derived from cron table and can also be referred to as that. Cron schedule jobs that is time based. Cron jobs are used to executes tasks at scheduled intervals.<o:p
The cron table syntax command has six fields that is separated by space. Now we shall be checking it one by one.
Java Interview questions and tutorials
Read: http://www.java67.com/2022/08/10-examples-of-crontab-commands-in-linux.html
