/** Program: Safe Class Purpose: demonstrates a Java Class and protections; @author john@december.com @version 1.04; 23 July 1995 */ class Safe { public int doorNumber = 123; private boolean locked = true; private int combination = 456; public boolean isLocked(){ return(locked); } public void unLock(int thisCombination) { if (thisCombination == combination) unLock(); } private void unLock() { locked = false; } private void setCombination(int setting) { combination = setting; } Safe () { } Safe (int door) { doorNumber = door; setCombination(doorNumber); // this is the trick to cracking a safe } }