Hit Counter

Steps

  1. Transient counter
  2. Persistent counter (use init and destroy)
  3. Add synchronization

Final Code

  • Source: smartsoft/tutorial/life/HitCounter.java
  • Run it

  • smartsoft.tutorial.life.HitCounter