Java Reference
In-Depth Information
int staffCount = 0;
for (Personnel person:response)
{
staffCount++;
System.out.println(
"\nStaff member " + staffCount);
System.out.println("Payroll number: "
+ person.getPayNum());
System.out.println("Surname: "
+ person.getSurname());
System.out.println("First names: "
+ person.getFirstNames());
}
System.out.println("\n\n");
}
catch(IOException ioEx)
{
ioEx.printStackTrace();
}
}
}
The only change required to the code for the
Personnel
class (now in its separate
fi le) will be the inclusion of
java.io.Serializable
in the header line (since
it is no longer subject to the import of package
java.io
):
class Personnel implements java.io.Serializable
Figure
4.6
shows a client accessing the server, while Fig.
4.7
shows the corre-
sponding output at the server end.
Search WWH ::
Custom Search