The member variable 'name' in the enum doesn't have an access specifier (public, protected, private), so it has default access - which means that other classes in the same package such as class Class can access it.
See
The Java Tutorial - Controlling Access to Members of a Class
Note that an enum is a kind of special class, and the access rules for classes apply to enums as well.