Hey guys,
I'm a java newbie struggling to correct this problem. It's an error mesage I get, don't understand why.
It's a homework assignment and I have to create Person, Date, SSN objects and run them in main together.
The error occurs when, in main, I try to create a new Person and plug in first name, last name, etc.
public class PersonTester { public static void main(String[] args) { Date hermanBday = new Date(11,11,2011); Person Ken = new Person(); Person Herman = new Person("Herman", 'H', "Wilson", hermanBday, "111-11-1111"); } //end main }//end class
I get this error message when I compile:
----jGRASP exec: javac -g PersonTester.java
PersonTester.java:8: cannot find symbol
symbol : constructor Person(java.lang.String,java.lang.String,java.lang .String,Date,java.lang.String)
location: class Person
Person Herman = new Person("Herman", 'H', "Wilson", sueBday, "111-11-1111");
^
1 error
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
Here's the Person class, the error message hints that something is wrong w my constructor (my default constructor seems to work fine)
public class Person { private String firstName; private char middleInitial; private String lastName; private Date birthdate; private SSN social; //no-arg constructor public Person() { firstName = null; middleInitial = '\0'; lastName = null; birthdate = null; social = null; } //constructor method public Person(String fn, char mi, String ln, Date bDate, SSN soc) { firstName = fn; middleInitial = mi; lastName = ln; birthdate = bDate; social = soc; } //toString Method public String toString() { String str = ( "\nFirst Name: " + firstName + "\nMiddle Initial: " + middleInitial + "\nLast Name: " + lastName + "\nBirthdate: " + birthdate + "\nSocial Security Number: " + social); return(str); }