Skip to content
Advertisement

Tag: terminology

What are fail-safe & fail-fast Iterators in Java

There are two types of iterators in Java: fail-safe and fail-fast. What does this mean, and is the difference between them? Answer What is the difference between them … “Fail-safe” (in engineering) means that something fails in a way that causes no or minimal damage. Strictly speaking, there is no such thing in Java as a fail-safe iterator. If an

java howto ArrayList push, pop, shift, and unshift

I’ve determined that a Java ArrayList.add is similar to a JavaScript Array.push I’m stuck on finding ArrayList functions similar to the following Array.pop Array.shift Array.unshift I’m leaning toward ArrayList.remove[At] Answer ArrayList is unique in its naming standards. Here are the equivalencies: Note that unshift does not remove an element, but instead adds one to the list. Also note that corner-case

Advertisement