Re: nullPointerException in abstract class
- From: Daniel Pitts <googlegroupie@xxxxxxxxxxxxx>
- Date: Sat, 29 Sep 2007 15:26:08 -0000
On Sep 29, 7:51 am, OldPro <rrossk...@xxxxxxxxxxxxx> wrote:
Why is this giving an error? birthDate is properly initialized, isn't
it?
public abstract class Employee
{
private String firstName;
private String lastName;
private String socialSecurityNumber;
private Date birthDate;
// three-argument constructor
public Employee( String first, String last, String ssn, String
birth )
{
firstName = first;
lastName = last;
socialSecurityNumber = ssn;
birthDate = new Date(); // Here is where the error occurs (it
doesn't stop the program)
birthDate.setDate(birth);
} // end three-argument Employee constructor
Please provide an SSCCE <http://physci.org/codes/sscce/>, so that we
can help you identify the real problem.
You might find the problem yourself in the process of creating the
SSCCE.
Good luck,
Daniel.
.
- References:
- nullPointerException in abstract class
- From: OldPro
- nullPointerException in abstract class
- Prev by Date: Re: nullPointerException in abstract class
- Next by Date: Re: nullPointerException in abstract class
- Previous by thread: Re: nullPointerException in abstract class
- Next by thread: Re: nullPointerException in abstract class
- Index(es):
Relevant Pages
|
|