Tag: Java

ArrayList and Iterator Example

This example shows how to use an iterator with ArrayList. Iterator can be used with other collections. output Note that if you are using Java 5 or above, you will…

Generating Random Numbers in Java

In programming, often we need to generate random numbers. All major languages provide functionality to generate pseudo-random numbers. In Java, this functionality is provided by java.util.Random. See example below: output…