ComboLock - lockerId=anId l public void...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab7; p public class ComboLock { int lockerId; String combination; S //default and overloaded constructors public ComboLock() { lockerId = 000000; combination = "--------"; } public ComboLock (int iD, String combo) { lockerId = iD; combination = combo; } //accessor methods public int getId() { return lockerId; } public String getCombination() { return combination; } //mutator methods / public void setId(int anId)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { lockerId=anId;} l public void setCombination(String aCombo) { combination=aCombo; } //equals method public boolean equals(ComboLock theLocker) { return(lockerId==(theLocker.getId())&& (combination==theLocker.getCombination())); } public String toString() { return "Locker ID: "+lockerId+"\tCombination: "+combination; } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online