Hi
I would appreciate it if someone could help me with this. This is my first java assignment so I may be asking a very basic question here...
basically I need to implement a constructor for class Person, which is fine. The following is taken from the assignment specification:
"[COLOR="Navy"]Person (String nme, char sex, Date dob) // post instance variables initialised with params // address !=null; natInsceNo= !=null; counter incremented[/COLOR]" for this constructor this is what I have done so far: public Person (String nme, char sex, Date dob) { name=nme; gender=Character.toString(sex); dateOfBirth=dob; address= " "; natInsceNo=" "; phoneNo=" "; counter++; }
however, I have not done anything to ensure that the required fields do not have a null value, as per the spec. Could you please advise me how to implement this to ensure complete compliance with the specification.
Thank you


LinkBack URL
About LinkBacks

Reply With Quote
by clicking the
button on their useful posts. 