4.1.4 Example of Simulation in Java


Now that we are familiar with most language constructs in Java we can look at an example of a simulation in Java. We shall simulate a game of flipping coins: