Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Immutable Data Structures/Collections/Containers
Gerard Gauthier
Ranch Hand
Posts: 127
2
I like...
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Simple question.
Does the
Java
standard library include immutable data structures? If it doesn't, is there any good ones available?
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
posted 5 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Plenty.
String
is a common one. You can also get an immutable view of all collections by calling one of the
Collections.unmodifiable...()
methods on it.
Gerard Gauthier
Ranch Hand
Posts: 127
2
I like...
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Perfect!
Campbell Ritchie
Marshal
Posts: 79178
377
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Java9 introduced methods like
this
,
this
and
this
. Note they are all heavily overloaded.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Crate an Immutable List?
not in scjp exam objectives...
How Functional can you be without Immutable / Persistent Data Structures?
Data structure in Java.
Tree dataStructure
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...