help me with getter and setters in class
Well, please read carefully AND answer me carefully..
this is written in a class called "Paycheck"
it is a setter method.
public void setCheckNum(String checkNum) {
this.checkNum = checkNum;
}
now i want to refuse any checkNumber != 8 digits...
how can i do it ??
and do i have to make any changes in the constructor ? or here in the setter method,,,
The idea is that i dont want to create an object if checkNum != 8 digits
Note :ALL data fields are private ..
please help !!:confused::confused::