nullPointerException in abstract class
- From: OldPro <rrosskopf@xxxxxxxxxxxxx>
- Date: Sat, 29 Sep 2007 07:51:17 -0700
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
.
- Follow-Ups:
- Re: nullPointerException in abstract class
- From: Roedy Green
- Re: nullPointerException in abstract class
- From: Roedy Green
- Re: nullPointerException in abstract class
- From: Daniel Pitts
- Re: nullPointerException in abstract class
- From: Matt Humphrey
- Re: nullPointerException in abstract class
- Prev by Date: Re: Accessing context parameters from web.xml in java class
- Next by Date: Re: ReadWriteLock rather on map's each field than whole map?
- Previous by thread: Good & Free UML modeling tool for Java/Eclipse?
- Next by thread: Re: nullPointerException in abstract class
- Index(es):
Relevant Pages
|