Java - Interview
Java Interview Java Script
Home
Multithreading
Hibernate
Spring
Android
Miscellaneous
TrackWise
TrackWise Tutorial
TrackWise Interview
SCJP
Object
Abstract
Array
Class
Constructor
Exception
Interview
Java
Spring
Hibernate
JSF
PL / SQL
JSP / Servlet
Web Services
Designing Patterns
Others
>>>
ERROR
Offensive Security
Struts 2
JSF
PHP
JDBC
JAVA
AWS
KOTLIN
Web Services
Friday, 4 September 2015
Collection : What are different ways to iterate over a list?
We can iterate over a list in two different ways – using
iterator
and using
for-each
loop.
Using iterator is more thread-safe because it makes sure that if underlying list elements are modified, it will throw ConcurrentModificationException.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment