Java examples for Object Oriented Design:Access Level
Use private access control:
class Logger { private String format; public String getFormat () { return this.format; } /*w ww .j av a 2 s.c om*/ public void setFormat (String fmt) { if ( (fmt.equals("common")) || (fmt.equals("combined")) ) { this.format = fmt; } } }