Media Blitz
2012-04-18 22:33:04 UTC
public class Person{
private String fsym;
private String lsym;
public Person(String firstname, String lastname){
if (firstname == null || lastname == null){
throw new NullPointerException();
}
fsym = firstname;
lsym = lastname;
}
public String getFirstName(){
return fsym;
}
public String getLastName(){
return lsym;
}
public boolean equals (Object other){
if (this != other){
return false;
}
return true;
}
public String toString(){
return "fsym " + "lsym";
}
}
All of this compiles, but because there is no main method, it cannot run. So, I put the main method after public Person{ but after I attempt to compile it, I get a bunch of errors. Such as:
Person.java:5: error: illegal start of expression
private String fysm;
I do not want to write the rest, but they are more or less along the same line.