Java9: Collections Factory Methods

Photo by Aviv Rachmadian on Unsplash
Set<String> set = Set.of("A","B","C");

List<String> list=List.of("A","B","C");

Map<String,String> map=Map.of("A","Apple","B","Boy","C","Cat");



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nuwan Zen

Nuwan Zen

Sometimes A software Engineer, sometimes a support engineer, sometimes a devops engineer, sometimes a cloud engineer :D That’s how the this life goes!