There's room for improvement there, but that depends on what you call "coding better". I think that the biggest concern with that code should be the way you hard-coded the relationship between IDs and classes. The simplest way to improve that is to have a property file somewhere, specifying this relationship.

For demonstration purposes, I will assume that the classes Person and Education both extend the class Something and that they all reside in the package "your.package". In that case, the property file would look like this:

For something like that (file parsing) nothing really comes to mind. You're going to do a string-based if/elseif/else comparison at some point ... what you have already at least has the benefit of being rather immediately clear. If you have a *bunch* of class types to check against, though, then you might worry more about it. Still, I'll be watching to see if/what someone else says... maybe I can pick up a good trick myself.