Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
Hi, I'm sure this is really simple, I can't figure out why this is happening. First, the code.
Code:
public abstract class BusinessObject {
public Vector validationMessage;
protected HashMap data = new HashMap();
public HashMap read () {
return data;
}
}
Code:
public abstract class Person extends BusinessObject {
public Person() {
}
public Person (String nameString) {
String newLast = "";
String newFirst = "";
if ( nameString.indexOf(",") != -1 ) {
newLast = nameString.substring( 0, nameString.indexOf(",") );
newFirst = nameString.substring( nameString.indexOf(",") + 1, nameString.length() );
} else if ( nameString.indexOf(" " ) != -1 ) {
newFirst = nameString.substring( 0, nameString.indexOf(" ") );
newLast = nameString.substring( nameString.indexOf(" ") + 1, nameString.length() );
}
Person(newLast, newFirst);
}
public Person (String newNameLast, String newNameFirst) {
data.put("nameLast", newNameLast);
data.put("nameFirst", newNameFirst);
}
}
When I try to compile Person.java, the compiler tells me that at the line Person(newLast, newFirst); inside the Person (String nameString) constructor, it 'cannot resolve symbol' on Person (java.lang.String, java.lang.String). I've moved the last Person constructor above the others, between the others, etc., but I know that shouldn't make a difference.
I've tried casting newLast = (String) nameString.substring(... and that doesn't work.
Thanks.