How can the posted code be tested? I don't see a main() method for execution.

Also please copy the full text of the error messages and pasted it here.