Code examples (Java Primer II)

Code examples (Java Primer II)

  1. Download and extract the content of the primer2.zip file into your project directory (compmodels).
  2. Within IntelliJ IDEA, go to File->Settings->Paths and click on the button to add a module. Select to import an existing module and specify primer2/primer2.iml.
  3. Like in the primer1 example, execute each code example by right-clicking on the entry class for the respective example and running the main method. The entry classes are
  • RussianRouletteWithObjects for the Russian roulette example
  • CarRace and SpeedTrap for the car race/speed trap example
  • Model for the Suv race example