Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How do you create a read-only collection?
How do you create a read-only collection?
✍: Guest
The Collections class has six methods to help out here:
1. unmodifiableCollection(Collection c)
2. unmodifiableList(List list)
3. unmodifiableMap(Map m)
4. unmodifiableSet(Set s)
5. unmodifiableSortedMap(SortedMap m)
6. unmodifiableSortedSet(SortedSet s)
If you get an Iterator from one of these unmodifiable collections, when you call remove(), it will throw an UnsupportedOperationException.
2012-08-30, 2638👍, 0💬
Popular Posts:
Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a chang...
What are the two kinds of comments in JSP and what's the difference between them? <%-- JSP Co...
How To Analyze Tables with "mysqlcheck"? - MySQL FAQs - Administrator Tools for Managing MySQL Serve...
How To Set session.gc_maxlifetime Properly? - PHP Script Tips - Understanding and Using Sessions As ...
What will be printed as the result of the operation below: main() { int a=0; if (a==0) printf("Cisco...