There is also the issue of version control. A static PDF represents a snapshot in time. While a 3rd Edition print run might receive minor corrections in subsequent reprints, a PDF downloaded from a repository is static. In an era where Java releases new versions every six months, a static file can quickly become a relic, lacking the errata and community updates that a legitimate purchase or digital subscription service (like O'Reilly Learning) might offer.
Search GitHub for the authors' names ( Kathy Sierra, Bert Bates, and Trisha Gee ) to find the legitimate code samples to follow along. Final Verdict head first java 3rd edition pdf github better