5.3.15. Java Data Structures

This app uses various data structures from the java.util package. The app dynamically loads the image file names for the enabled regions and stores them in an ArrayList<String>. We use Collections method shuffle to randomize the order of the image file names for each new game. We use a second ArrayList<String> to hold the image file names of the countries in the current quiz. We also use a Set<String> to store the world regions included in a quiz. We refer to the ArrayList<String> object with a variable of interface type List<String>—this is a good Java programming practice that enables you to change data structures easily without affecting the rest of your app’s code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.248.90