Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Usage of new Collections factory methods introduced with Java 9

Initializing a Set

Set countrySet = Set.of("France","Belgium","Germany");

Initializing a List

List countryList = List.of("France","Belgium","Germany");

Initializing a Map

Map countryCodeMap = Map.of("France","FR","United States","US","Canada","CA");




This post first appeared on Techsharepoint, please read the originial post: here

Share the post

Usage of new Collections factory methods introduced with Java 9

×

Subscribe to Techsharepoint

Get updates delivered right to your inbox!

Thank you for your subscription

×