Can the same classes be used on the client and the server?

You can create Java classes that can be used on different levels of an enterprise application. You can integrate the same Java class into either the client application, a middle tier, or the database.

Take care that classes used in different tiers, or in the same tier over time, remain compatible or are knowingly made incompatible so that behavior is consistent across the application. See the Java documentation on the serialVersionUID in the java.io.Serializable class for details.