fa
Feedback
Чашечка Java

Чашечка Java

رفتن به کانال در Telegram

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

نمایش بیشتر
8 550
مشترکین
-424 ساعت
-137 روز
-3230 روز
آرشیو پست ها
How to Synchronize HashMap in Java? Collections.synchronizedMap() Example Tutorial Hello guys, if you have used HashMap class
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

Difference between WeakHashMap , IdentityHashMap, and EnumMap in Java? Hello guys, if you are wondering what is the differenc
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

Практические примеры использования Stream API Всем привет! Решил написать статью с практическими примерами использования Stream API. В данной статье не будет теории - только хардкор и практические примеры. Поехали! В качестве "подопытного кролика" буду использовать проект, который можете найти здесь. Для тестирования буду использовать Postman. В проекте есть три сущности с которыми мы будем работать: Client, Product и Booking. Связи между ними можно посмотреть на следующей картинке. Читать: https://habr.com/ru/post/684912/?utm_campaign=684912

How to Execute threads in order in Java - Join Example Sometime we need to execute multiple threads in a particular order e.g
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

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
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

Java HashMap keySet() , entrySet and values() Example - Tutorial The java.util.Map interface provides three methods keySet(),
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

10 Examples of HashMap in Java - Programming Tutorial The HashMapin Java is one of the most popular Collection classes among
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

Введение в DbChange JUnit расширение Простой и декларативный способ выполнять SQL запросы в JUnit тестах. Читать: https://habr.com/ru/post/684692/?utm_campaign=684692

Почему после 25+ лет в профессии и десятка-другого языков я бы рекомендовал начинать с Java Когда-то в мире был только Си. Или Бэйсик. Или Паскаль. Это если не считать ассемблер для КР580ВМ. И хотя в книгах можно было найти упоминание ещё и о Фортране, но уже тогда, вместе с упоминаниями, были и предостережения о не самом удачном выборе, если бы вам вдруг захотелось писать на этом языке. Так выглядел мир глазами школьника из СССР. Начинать тогда предлагалось с Бэйсика. Журнал "Наука и жизнь" так прямо и указывал. А заодно предлагал серию статей, заменявших вводный курс программирования начинающим хакерам. Была, конечно, ещё и "Техника молодёжи" с её занимательно составленным введением в программирование, но только на программируемом калькуляторе. Сегодня, наверное, сложно себе представить, как можно было увлечься каким-то программируемым калькулятором, ведь все с детства привыкли к айфонам с андроидами, но в те стародавние времена, когда книг с фантастикой в местной библиотеке было мало, школьники как некое чудо воспринимали коротенькие фантастические рассказы в "Технике молодёжи", сопровождавшиеся показом, как можно самостоятельно рассчитать все манёвры главного героя около Луны и летавшей где-то неподалёку окололунной станции. Так мы входили в АйТи. Или в IT? Ну тогда мы даже аббревиатуры такой не знали. А потом пришлось взрослеть. Читать: https://habr.com/ru/post/684786/?utm_campaign=684786

Article: How To Speed Up Large Collections Processing in Java A review on Java performance for many objects using Java Collec
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/

Java on Visual Studio Code Update – August 2022 Read: https://devblogs.microsoft.com/java/java-on-visual-studio-code-update-a
Java on Visual Studio Code Update – August 2022 Read: https://devblogs.microsoft.com/java/java-on-visual-studio-code-update-august-2022/

4 канала для тех, кто хочет прокачаться в определённом направлении программирования: — по анализу данных: @big_data_analysis — по DevOps: @devo_pes — по веб-разработке: @tproger_web — по мобильной разработке: @mobi_dev

10 examples of crontab commands in Linux In Today's article, You shall be learning the 10 examples of crontab commands in Lin
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

How to convert a Map to List in Java? HashMap to ArrayList Example Before converting a Map to a List in Java, we should be ve
How to convert a Map to List in Java? HashMap to ArrayList Example Before converting a Map to a List in Java,  we should be very clear about these data structures which are widely used in Java. So let's begin with Map. What is Map? Map is an Interface in Java which store key and value object. It's a Java representation of a popular hash table data structure that allows you to search an existing element in O(1) time, at the same time also makes insertion and removal easier.  We use a key object to retrieve the value object by using hashing functionality provided by Map. As we have seen in how the get method of HashMap works, In Java, the equals() and hashcode() methods are an integral part of storing and retrieving objects from it. The map allows duplicate values but no duplicate keys. Java Interview questions and tutorials Read: http://www.java67.com/2015/01/how-to-convert-map-to-list-in-java.html

What is static and instance Method in Java? Example Tutorial Hello guys, if you have trouble understanding what is static method in Java and how to use it then you are at the right place. In this article, I will share everything I have learned bout static method in my 20 years of Java experience. Static methods are one of the important programming concepts in any programming language but unfortunately, it is also the most misunderstood and misused one. Talking about Java, almost all programmers know that. static methods belong to the class and non-static methods belong to the objects of the class, but hardly all of them understand what it means. That's why this is one of the popular weed-out questions on programming interviews. Java Interview questions and tutorials Read: http://www.java67.com/2014/10/difference-between-static-and-non-static-method-java-programming.html

How to use Lambda Expression and method reference in Java? Example Tutorial Hello guys, if you are wondering what is lambda e
How to use Lambda Expression and method reference in Java? Example Tutorial Hello guys, if you are wondering what is lambda expression and method reference in Java then you are at the right place. Earlier, I have shared 10 Stream API examples and in this article, I will share everything I know about Lambda expression with you. The Lambda expressionis one of the most important features of Java 8 which has opened a whole new dimension of programming paradigm in Java. It is the feature which made the Functional Programming possible in Java because now you can pass the code to a function to execute as opposed to an object. You might be a bit surprised but if you look from a developer's point of view, it is nothing but a way to pass your code to a method in Java. Java Interview questions and tutorials Read: http://www.java67.com/2017/06/10-points-about-lambda-expressions-in-java-8.html

Что означает I в ACID и как это можно использовать Пройдя много собеседований, выяснилось, что довольно приличная часть собеседующих, спрашивавших или как-то затрагивавших тему транзакций и их работы, не знают как работают транзакции и что означает для разработчика термин изоляция. Вплоть до архитектора в одной очень большой российской компании, для которого выводы, использованные мною для формулирования решения при прохождении архитектурной секции оказались чем-то вроде бреда. Пока готовится вторая статья (Миллиард абитуриентов МИРЭА 2), можно отвлечься и разбрать тему, продемонстрировать разработчикам что означает для них I в ACID. Попробовать заблокировать запись Читать: https://habr.com/ru/post/684570/?utm_campaign=684570

Difference between HashMap vs TreeMap vs LinkedHashMap in Java Hello guys, if you are wondering when to use HashMap, TreeMap and LinkedHashMap in Java and want to understand difference between them then you are at the right place. Earlier, I have shared difference between HashSet, TreeSet, and LinkedHashSet and in this article, I will explain the difference between these three common Map implementation HashMsp, TreeMap, and LinkedHashMap. Though all three classes like HashMap, LinkedHashMap and TreeMap are implementation of java.util.Map interface, there is some functional difference between them. Perhaps most notable difference between them comes from their iteration order. HashMap makes absolute no guarantee about in which order you can iterate their keys, any application depending upon iteration order of HashMap is fragile, because it can change anytime. In fact, in Java 7, iteration order of HashMap is different than Java 6. Java Interview questions and tutorials Read: http://www.java67.com/2022/05/hashmap-vs-treemap-vs-linkedhashmap-in.html

photo content

3 Examples to Convert Date to LocalDate in Java 8? Tutorial One of the great features of Java 8 is the new Date and Time API
3 Examples to Convert Date to LocalDate in Java 8? Tutorial One of the great features of Java 8 is the new Date and Time API which is intended to fix existing issues related to mutability and thread-safety with existing java.util.Date class. But given java.util.Date is used very heavily across all the Java applications, you will often end up with a situation where you need to convert java.uti.Date to java.time.LocalDate while working in Java 8. Unfortunately there is no toLocalDate() method in the java.util.Date class. Though, you can easily convert Date to LocalDate if you are familiar with how new and old API classes map to each other. Java Interview questions and tutorials Read: http://www.java67.com/2019/10/3-ways-to-convert-javautildate-to-LocalDate-java8-example.html