public class Employee
{
public
String ssnToName(String ssn)
{
String employeeName = "";
String [] empArray = {"Mary Lou Buford", "Billy Bob Jackson", "John Doe", "Jane Doe", "Sally Jo Pitkin"} ;
String [] ssnArray = {"111111111", "222222222", "333333333", "444444444", "555555555"};
for (int i=0; i<5; ++i)
{
if (ssnArray[i].equals(ssn))
{
employeeName = empArray[i];
}
else
{
employeeName = "No such employee";
}
}
return employeeName;
} //end of SSNToName
}//end of class
Why does this not work?
EB