previous | start | next

## Programming Style: Fields

- Some programmers put fields before methods:

      public class Greeter

      {

         private String name;

         public Greeter(String aName) { . . . }

         . . .

      }

- From OO perspective, it is better to list the `public` interface first
- All fields should be `private`
- Don't use default (package) visibility

previous | start | next