A class can define not just public static fields, but also private static fields. Because the field is static, there is just one copy of the associated data stored–regardless of the number of instances of the class. And because the field is private, it’s not visible to code outside of the class.

In the example below, the Dog class defines two private static variables, used for tracking the last dog who barked.