Sdscompany.ru

Компьютерный журнал
0 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд
Загрузка...

Java concurrent set

ConcurrentSkipListSet в Java с примерами

Класс ConcurrentSkipListSet в Java является частью Java Collection Framework и реализует интерфейс Collection и класс AbstractSet . Он предоставляет масштабируемую и параллельную версию NavigableSet в Java . Реализация ConcurrentSkipListSet основана на ConcurrentSkipListMap. Элементы в ConcurrentSkipListSet сортируются по умолчанию в их естественном порядке.

Конструкторы в Java ConcurrentSkipListSet:

  • ConcurrentSkipListSet () : этот конструктор используется для создания пустого набора.
  • ConcurrentSkipListSet (Collection c) : этот конструктор используется для создания набора с элементами коллекции, переданными в качестве параметра.
  • ConcurrentSkipListSet (Comparator компаратор) : этот конструктор используется для создания нового пустого набора, который упорядочивает свои элементы в соответствии с указанным компаратором.
  • ConcurrentSkipListSet (SortedSet s) : этот конструктор используется для создания нового набора, содержащего те же элементы и использующего тот же порядок, что и указанный отсортированный набор.

Ниже приведен пример программы для иллюстрации ConcurrentSkipListSet в Java:

// Java-программа для демонстрации ConcurrentSkipListSet

public static void main(String[] args)

// Инициализация набора с использованием ConcurrentSkipListSet ()

set = new ConcurrentSkipListSet ();

// Добавление элементов в этот набор

// Инициализация набора с использованием

set1 = new ConcurrentSkipListSet (set);

Методы в Java ConcurrentSkipListSet:

  1. add (E e) : этот метод добавляет указанный элемент в этот набор, если он еще не существует.
  2. потолок (E e) : этот метод возвращает наименьший элемент в этом наборе, больший или равный данному элементу, или ноль, если такого элемента нет.
  3. clear () : этот метод удаляет все элементы из этого набора.
  4. clone () : этот метод возвращает поверхностную копию этого экземпляра ConcurrentSkipListSet.
  5. comptor (): этот метод возвращает компаратор, используемый для упорядочения элементов в этом наборе, или ноль, если этот набор использует естественное упорядочение своих элементов.
  6. Содержит (Object o) : этот метод возвращает true, если этот набор содержит указанный элемент.
  7. downndingIterator () : этот метод возвращает итератор для элементов этого набора в порядке убывания.
  8. downndingSet () : этот метод возвращает представление в обратном порядке элементов, содержащихся в этом наборе.
  9. equals (Object o) : этот метод сравнивает указанный объект с этим набором на равенство.
  10. first () : этот метод возвращает первый (самый низкий) элемент, находящийся в данный момент в этом наборе.
  11. floor (E e) : этот метод возвращает наибольший элемент в этом наборе, меньший или равный данному элементу, или ноль, если такого элемента нет.
  12. headSet (E toElement) : этот метод возвращает представление части этого набора, элементы которой строго меньше, чем toElement.
  13. headSet (E toElement, boolean inclusive) : этот метод возвращает представление части этого набора, элементы которой меньше (или равны, если inclusive is true) toElement.
  14. upper (E e) : этот метод возвращает наименьший элемент в этом наборе, строго превышающий заданный элемент, или ноль, если такого элемента нет.
  15. isEmpty () : этот метод возвращает true, если этот набор не содержит элементов.
  16. iterator () : этот метод возвращает итератор для элементов этого набора в порядке возрастания.
  17. last (): этот метод возвращает последний (самый высокий) элемент в настоящее время в этом наборе.
  18. lower (E e) : этот метод возвращает наибольший элемент в этом наборе строго меньше, чем данный элемент, или ноль, если такого элемента нет.
  19. pollFirst () : этот метод извлекает и удаляет первый (самый низкий) элемент или возвращает ноль, если этот набор пуст.
  20. pollLast () : этот метод извлекает и удаляет последний (самый высокий) элемент или возвращает ноль, если этот набор пуст.
  21. remove (Object o) : Этот метод удаляет указанный элемент из этого набора, если он присутствует.
  22. removeAll (Collection c) : этот метод удаляет из этого набора все его элементы, которые содержатся в указанной коллекции.
  23. size () : этот метод возвращает количество элементов в этом наборе.
  24. spliterator () : этот метод возвращает Spliterator над элементами этого набора.
  25. subSet (E fromElement, логическое значение fromInclusive, E toElement, логическое значение toInclusive) : этот метод возвращает представление части этого набора, элементы которого варьируются от fromElement до toElement.
  26. subSet (E fromElement, E toElement) : Этот метод возвращает представление части этого набора, элементы которого варьируются от fromElement, включительно, до toElement, эксклюзив.
  27. tailSet (E fromElement): этот метод возвращает представление части этого набора, элементы которой больше или равны fromElement.
  28. tailSet (E fromElement, boolean inclusive) : Этот метод возвращает представление части этого набора, элементы которой больше (или равны, если inclusive is true) fromElement.

// Java-программа для демонстрации ConcurrentSkipListSet

public static void main(String[] args)

// Инициализация набора с использованием ConcurrentSkipListSet ()

set = new ConcurrentSkipListSet ();

// Добавление элементов в этот набор

// используя метод add ()

// Печать самого высокого элемента набора

// используя метод last ()

System.out.println( «The highest element of the set: «

// Извлечение и удаление первого элемента набора

How to create a thread-safe ConcurrentHashSet in Java 8?

Posted by: Javin Paul in Core Java August 11th, 2017 0 Views

Until JDK 8, there was no way to create a large, thread-safe, ConcurrentHashSet in Java. The java.util.concurrent package doesn’t even have a class called ConcurrentHashSet, but from JDK 8 onwards, you can use newly added keySet(default value) and newKeySet() method to create a ConcurrentHashSet backed by ConcurrentHashMap. Unlike tactical solutions like using concurrent hash map with dummy value or using the set view of the map, where you cannot add new elements. The Set returned by keySet(defaultValue) and newKeySet() method of JDK 8 is a proper set, where you can also add new elements along with performing other set operations e.g. contains(), remove() etc. Though you need to be careful that these methods are only available in ConcurrentHashMap class and not in ConcurrentMap interface, so you need to use a ConcurrentHashMap variable to hold the reference, or you need to use type casting to cast a ConcurrentHashMap object stored in ConcurrentMAp variable.

The Java Concurrency API has concurrent versions of popular Collection classes e.g. CopyOnArrayList for ArrayList, ConcurrentHahsMap for HashMap and CopyOnWriteArraySet for HashSet, but there was nothing like ConcurrentHashSet in Java. Even though, CopyOnWriteArraySet is thread-safe it is not suitable for application where you need a large thread-safe set. It is only used for application where set sizes stay small and read-only operations vastly outnumber write operations.

So, when you ask Java programmers about how to create ConcurrentHashSet without writing their own class, many will say that they can use ConcurrentHashMap with bogus values. This is in fact what Java also does because if you know HashSet internally uses HashMap with same values.

But, the problem with this approach is that you have a map and not set. You cannot perform set operations on your ConcurrentHashMap with dummy values. You cannot pass it around when some method expects a set, so it’s not very usable.

The other option, many Java programmer will mention that you can get a Set view from ConcurrentHashMap by calling the keySet() method, which in fact return a Set, where you can perform Set operations and pass it around to a method which expects a Set but this approach also has its limitation e.g. the Set is backed by ConcurrentHashMAp and any change in Map will reflect in Set as well. Another limitation was that you cannot add new elements into this key set, doing so will throw UnsupportedOperationException. See
Java 8 in Action to learn more about it.

Читать еще:  Javascript try catch

Both of these limitations are now thing of past because JDK 8 has added newKeySet() method which returns a Set backed by a ConcurrentHashMap from the given type where values are Boolean.TRUE. Unlike Set view returned from the keySet() method, you can also add new objects into this Set. The method is also overloaded and accepts an initial capacity to prevent resizing of Set.

Here is a code example to create ConcurrentHashSet in Java 8:

Btw, this is not the only way to create a concurrent, large, thread-safe Set in Java. You can also use the newly added, overloaded keySet(default value) method to create a ConcurrentHashSet. This method returns a Set view of the keys in the ConcurrentHashMap, using the given common default value for any additions (i.e., Collection.add and Collection.addAll(Collection)).

This is of course only use you can use the same value for all elements in the Set, which is ok in most situations because you don’t really care about values in Set. Remember, HashSet is also a HashMap with same values for all elements, See How HashSet works internally in Java for more details.

Here is the example to obtain a ConcurrentHashSet using keySet(mapped value) method in Java 8:

you can also perform other Set operations e.g. addAll(), remove(), removeAll(), retainAll(), contains() with this Set. It is also thread-safe, so can be used in multi-threading Java applications. You can learn more about set based operations on Java SE 8 for the Really Impatient.

Java Program to create ConcurrentHashSet from ConcurrentHashMAp.

Here is our complete Java program to create a large, thread-safe, concurrent hash set in Java 8 using new methods added on java.util.concurrent.ConcurrentHashMap class

You can see that if you try to add new objects into Set returned by the keySet() method of ConcurrentHashMAp, it throws UnsupportedOperationExcepiton as shown below:

Exception in thread “main” java.lang.UnsupportedOperationException

at java.util.concurrent.ConcurrentHashMap$KeySetView.add(ConcurrentHashMap.java:4594) at Demo.main(Demo.java:23)

That’s why I have commented that code, but, Set returned by newKeySet() and keySet(mapped value) methods allows you to add new elements into the Set, there is no error there.

By the way, this is not the only way to create a thread-safe Set in Java. Even before Java 8, there is a class called CopyOnWriteArraySet which allows you to create a thread-safe set in Java. It is similar to CopyOnWriteArrayList and only suitable for application where set size is small and you only do read the only operation because it copies all elements from Set to a new Set every time you write into it. See Java SE 8 for the Really Impatient to learn more about concurrent collections in Java 8.

Here are some of the important properties of CopyOnWriteArraySet:

1. It is best suited for applications in which set sizes generally stay small, read-only operations vastly outnumber mutative operations, and you need to prevent interference among threads during traversal.

2. It is thread-safe.

3. Mutative operations (add, set, remove, etc.) are expensive since they usually entail copying the entire underlying array.

4. Iterators do not support the mutative remove operation.

5. Traversal via iterators is fast and cannot encounter interference from other threads.

6. Iterators rely on unchanging snapshots of the array at the time the iterators were constructed.

That’s all about how to create ConcurrentHashSet in Java 8. The JDK 8 API not only has major features like lambda expression and stream but also these kinds of small changes which make your day to day coding easier. IT’s not super easy to create a ConcurrentHashSet in Java using the newKeySet() method. You don’t need to use a map like a set with a bogus value or live with the limitation of set view returned by keySet() which doesn’t allow you to add new elements into the Set.

Further Reading

Related articles:

How to write Comparator in Java 8?
how to read File in Java 8?
How to join String in Java 8?
How to compare Dates in Java 8?
How to format Date in Java 8?
How to sort a List in Java 8?

Thanks a lot for reading this article. If you like this tutorial then please share with your friends and colleagues.

Tech Tutorials

Tutorials and posts about Java, Spring, Hadoop and many more. Java code examples and interview questions. Spring code examples.

Thursday, August 23, 2018

ConcurrentSkipListSet in Java

ConcurrentSkipListSet in Java is a scalable concurrent set in Java which uses ConcurrentSkipListMap internally. Though concurrent collections like ConcurrentHashMap and CopyOnWriteArraySet were added in Java 1.5, ConcurrentSkipListSet and the similar map implementation ConcurrentSkipListMap were added in Java 1.6.

ConcurrentSkipListSet in Java

Since ConcurrentSkipListSet implements NavigableSet in Java, it is a sorted set just like TreeSet with added feature of being concurrent. Which essentially means it is a sorted data structure which can be used by multiple threads concurrently where as TreeSet is not thread safe.

The elements of the ConcurrentSkipListSet are kept sorted according to their natural ordering, or by a Comparator provided at set creation time, depending on which constructor is used.

Java ConcurrentSkipListSet constructors

  • ConcurrentSkipListSet()— Constructs a new, empty set that orders its elements according to their natural ordering.
  • ConcurrentSkipListSet(Collection c)— Constructs a new set containing the elements in the specified collection, that orders its elements according to their natural ordering.
  • ConcurrentSkipListSet(Comparator comparator)— Constructs a new, empty set that orders its elements according to the specified comparator.
  • ConcurrentSkipListSet(SortedSet s)— Constructs a new set containing the same elements and using the same ordering as the specified sorted set.Paste your text here.

Java ConcurrentSkipListSet performance

ConcurrentSkipListSet implementation provides expected average log(n) time cost for the contains, add, and remove operations and their variants. Insertion, removal, and access operations safely execute concurrently by multiple threads.

No Nulls in ConcurrentSkipListSet

ConcurrentSkipListSet does not permit the use of null elements, because null arguments and return values cannot be reliably distinguished from the absence of elements.

ConcurrentSkipListSet Java example

Let’s see an example where we add some values in a ConcurrentSkipListSet and in the output it can be seen that the elements are sorted. In this example elements are of type String and for String natural ordering is ascending alphabetical order. So when you iterate the set you’ll see it is in sorted same way.

Note that ConcurrentSkipListSet like any other set implementation i.e. HashSet can only store unique elements. Also, as mentioned internally it uses ConcurrentSkipListMap so when you call add method of ConcurrentSkipListSet it will in turn call putIfAbsent() method of the concurrentMap, that way element is stored only if it is not there already.

Navigable methods in ConcurrentSkipListSet

As already mentioned ConcurrentSkipListSet in Java implements NavigableSet interface so it has many navigation methods returning the closest matches for given search targets. Let’s see some of them in example code.

  • higher(E e)— Returns the least element in this set strictly greater than the given element, or null if there is no such element.
  • lower(E e)— Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
  • tailSet(E fromElement)— Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
Читать еще:  Java development toolkit

Here higher as the description says is returning the least element in this set strictly greater than the given element. Since given element is «C» so returned value is «Chennai». Note that passed element doesn’t have to be the one already present in set as here «C» is passed which is not an element of the Set.

lower as the description says is returning the greatest element in this set strictly less than the given element. Passed element is «Mumbai» so that returned element is «Hyderabad».

Recommendations for learning

That’s all for this topic ConcurrentSkipListSet in Java. If you have any doubt or any suggestions to make please drop a comment. Thanks!

How to use ConcurrentHashSet from ConcurrentHashMap in Java 8 — Example Tutorial

There is no ConcurrentHashSet in JDK 8 but you can still create one for yourself by using the ConcurrentHashMap class of java.util.concurrent package. There is a new method added into ConcurrentHashMap in JDK 8, newKeySet() , which allows you to create a concurrent hash set backed by a concurrent hash map. If you remember whenever you get keys from the map they are returned in a Set e.g. for the old keySet() method because map only has unique keys. Since map doesn’t allow duplicate keys, it can be used as a set, as long as you only care for keys or just one element. That’s why Java designers are added newKeySet() method to convert a map to set. This is also a static method, which means you don’t need a ConcurrentHashMap object to create a concurrent hash set.

The Set returned by the keySet() method is backed by a ConcurrentHashMap with given keys and values are always Boolean.TRUE . It is also overloaded to accept initial capacity to avoid internal re-sizing. If you know, the HashSet class also internally uses an HashMap where values are always same, an object, which is possible because Map allows duplicate values.

Unlike the List returned by Arrays.asList() , which doesn’t allow you to add or remove elements, the Set returned by newKeySet() is like any normal Set implementations and allows you add, remove or perform any other Set operation. You can even pass this Set to a method which is accepting a Set interface as a parameter. I’ll show this in coming example.

Java Program to create ConcurrentHashSet

Here is our Java program to demonstrate how you can generate a ConcurrentHashSet in JDK 8 by using the newKeSet() method added into java.util.concurrent.ConcurrentHashMap class. Even though I have used an object of the concurrent hash map here, it’s not required because unlike keySet() , the newKeySet() is a static method.

Let’s the code to actually generate a concurrent hash set in Java 8:

You can see that you can easily add and remove elements from the Set returned by newKeySet() method. As I said, the Set is backed by ConcurrentHashMap , which means multiple readers can retrieve values at the same time and also multiple writers can insert values into the set without blocking, until the read and write operation is happening in the same segment. You can also see Java Fundamentals: Collections to learn more about the internal implementation of various collection classes of Java API.

Btw, If you remember, concurrent hash map never locks the whole map, instead, it divides the map into several segments, by default 16, also knowns as concurrency level and only locks the segment where modification is happening. This means multiple writes is possible if they are happening at different segments.

Btw, the concurrent hash set is not only thread-safe set which is available in JDK, you have some more choices e.g. you can use CopyOnWriteArraySet , which is similar to CopyOnWriteArrayList i.e. it copies the whole collection into new one whenever a write happens but because of this behavior they are only useful for a set with small number of elements with infrequent write. You can further read the Java: A Beginners Guide 6th Edition for more details on concurrent collection classes.

That’s all about how to convert ConcurrentHashMap to ConcurrentHashSet in Java. This is a nice little tip which allows you to use a map as Set with all the concurrency benefits provided by concurrent hash map without any extra effort. They newKeySet() is like any static factory method, which you can invoke with the class name without even needing a ConcurrentHashMap object.

Other Java Collection tutorials you may like
How HashMap internally works in Java? (answer)
What is the difference between HashSet, TreeSet, and LinkedHashSet in Java? (answer)
10 Java HashMap based Interview Questions with Answers (list)
What is the difference between HashMap and LinkedHashMap in Java? (answer)
How to sort a Map by values in Java 8? (tutorial)
How to sort an ArrayList using Comparator in Java 8? (tutorial)
What is the difference between Iterator and ListIterator in Java? (answer)
How to remove elements from HashMap during iteration in Java? (answer)

Thanks for reading this article, if you like this article then please share with your friends and colleagues. If you have any question or feedback then please drop a comment.

How to Create a thread-safe ConcurrentHashSet in Java 8? Example

Until JDK 8, there was no way to create a large, thread-safe, ConcurrentHashSet in Java. The java.util.concurrent package doesn’t even have a class called ConcurrentHashSet , but from JDK 8 onwards, you can use the newly added keySet(default value) and newKeySet() methods to create a ConcurrentHashSet backed by ConcurrentHashMap in Java. This is better than old tactical solutions like using a concurrent hash map with dummy value or using the set view of the map, where you cannot add new elements. The Set returned by keySet(defaultValue) and newKeySet() methods of JDK 8 is a proper set, where you can also add new elements along with performing other set operations e.g. contains() , remove() etc.

Though you need to be a little bit careful because these methods are only available in ConcurrentHashMap class and not in ConcurrentMap interface, so you need to use a ConcurrentHashMap reference variable to hold the reference, or you need to use type casting to cast a ConcurrentHashMap object stored in ConcurrentMap variable.

Btw, this is one of the many useful library enhancement present in JDK 8. If you want to learn more about changes in Java 8, I suggest you take a look at What’s New in Java 8 course on Pluarlsight. It provides a nice summary of useful changes from Java 8.

1. Concurrent Collections in Java

The Java Concurrency API has concurrent versions of popular Collection classes e.g. CopyOnArrayList for ArrayList , ConcurrentHahsMap for HashMap and CopyOnWriteArraySet for HashSet , but there is nothing like ConcurrentHashSet in Java.

Читать еще:  Java sdk что это

Even though, CopyOnWriteArraySet is thread-safe it is not suitable for application where you need a large thread-safe set. It is only used for application where set sizes stay small and read-only operations vastly outnumber write operations.

So, when you ask Java programmers about how to create ConcurrentHashSet without writing their own class, many will say that they can use ConcurrentHashMap with same values. This is in fact what Java also does to create HashSet. If you have read my article how HashSet internally works in Java, you may remember that HashSet internally uses HashMap with the same values.

But, the problem with this approach is that you have a map and not set. You cannot perform set operations on your ConcurrentHashMap with dummy values. You cannot pass it around when some method expects a Set, so it’s not very usable.

The other option, many Java programmer will mention that you can get a Set view from ConcurrentHashMap by calling the keySet() method, which in fact return a Set , where you can perform Set operations and pass it around to a method which expects a Set but this approach also has its limitation.

For example, the Set is backed by ConcurrentHashMap and any change in Map will reflect in Set as well. Another limitation was that you cannot add new elements into this key set, doing so will throw UnsupportedOperationException .

If you are not familiar about this exception, I suggest you join The Complete Java MasterClass — Updated for Java 11, one of the best resources to learn Java by yourself.

Anyway, both of these limitations are now thing of past because JDK 8 has added newKeySet() method which returns a Set backed by a ConcurrentHashMap from the given type where values are Boolean.TRUE .

Unlike Set view returned from the keySet() method, you can also add new objects into this Set . The method is also overloaded and accepts an initial capacity to prevent resizing of Set.

1. 1 ConcurrentHashSet using newKeySet() in Java 8

Here is a code example to create ConcurrentHashSet in Java 8:

Btw, this is not the only way to create a concurrent, large, thread-safe Set in Java.

You can also use the newly added, overloaded keySet(default value) method to create a ConcurrentHashSet . This method returns a Set view of the keys in the ConcurrentHashMap , using the given common default value for any additions (i.e., Collection.add() and Collection.addAll(Collection)) .

This is of course only use you can use the same value for all elements in the Set, which is Ok in most situations because you don’t really care about values in Set. Remember, HashSet is also a HashMap with the same values for all elements, See Java Fundamentals: Collections by Richard Warburton for more details.

1. 2 ConcurrentHashSet using keySet(default value)

you can also perform other Set operations e.g. addAll(), remove(), removeAll(), retainAll(), contains() with this Set. It is also thread-safe, so can be used in multi-threading Java applications. You can learn more about set-based operations on The Complete Java MasterClass — Updated for Java 11.

Java Program to Create ConcurrentHashSet from ConcurrentHashMap

Here is our complete Java program to create a large, thread-safe, concurrent hash set in Java 8 using new methods added on java.util.concurrent.ConcurrentHashMap class

You can see that if you try to add new objects into Set returned by the keySet() method of ConcurrentHashMap , it throws UnsupportedOperationExcepiton as shown below:

Exception in thread «main» java.lang.UnsupportedOperationException
at java.util.concurrent.ConcurrentHashMap$KeySetView.add(ConcurrentHashMap.java:4594)
at Demo.main(Demo.java:23)

That’s why I have commented that code, but, Set returned by newKeySet() and keySet(mapped value) methods allows you to add new elements into the Set, there is no error there.

By the way, this is not the only way to create a thread-safe Set in Java. Even before Java 8, there is a class called CopyOnWriteArraySet which allows you to create a thread-safe set in Java.

It is similar to CopyOnWriteArrayList and only suitable for application where set size is small and you only do read the only operation because it copies all elements from Set to a new Set every time you write into it. See Java SE 8 for the Really Impatient to learn more about concurrent collections in Java 8.

Here are some of the important properties of CopyOnWriteArraySet:

1. It is best suited for applications in which set sizes generally stay small, read-only operations vastly outnumber mutative operations, and you need to prevent interference among threads during traversal.

2. It is thread-safe.

3. Mutative operations (add, set, remove, etc.) are expensive since they usually entail copying the entire underlying array.

4. Iterators do not support the mutative remove operation.

5. Traversal via iterators is fast and cannot encounter interference from other threads.

That’s all about how to create ConcurrentHashSet in Java 8. The JDK 8 API not only has major features like lambda expression and stream but also these kinds of small changes which make your day to day coding easier. It’s not super easy to create a ConcurrentHashSet in Java using the newKeySet() method.

You don’t need to use a map like a set with a bogus value or live with the limitation of set view returned by keySet() which doesn’t allow you to add new elements into the Set .

Related Java 8 Tutorials
If you are interested in learning more about new features of Java 8, here are my earlier articles covering some of the important concepts of Java 8:

  • Top 5 Java 8 Courses for Programmers (courses)
  • 20 Examples of Date and Time in Java 8 (tutorial)
  • 5 Books to Learn Java 8 from Scratch (books)
  • How to join String in Java 8 (example)
  • How to use forEach() method in Java 8 (example)
  • How to use filter() method in Java 8 (tutorial)
  • 10 examples of Optionals in Java 8? (example)
  • How to use Stream class in Java 8 (tutorial)
  • How to use peek() method in Java 8 (example)
  • How to convert List to Map in Java 8 (solution)
  • How to format/parse the date with LocalDateTime in Java 8? (tutorial)
  • How to sort the map by keys in Java 8? (example)
  • 10 Java 8 Stream and Functional Programming Interview Questions (answers)
  • How to use findFirst() method of Stream in Java 8 (example)
  • Java 8 map + filter + collect + stream example (tutorial)

Thanks for reading this article so far. If you like this article then please share with your friends and colleagues. If you have any question or feedback then please drop a comment.

P. S. — If you don’t mind learning from free resources then you can also check out this list of free Java 8 and Java 9 courses to learn better.

P. P. S. — If you like to learn from books then Java 8 in Action is the best book to learn both Java 8 features as well as other API enhancements made in JDK 8.

Ссылка на основную публикацию
Adblock
detector