Next comes the class declaration. It is of the following form:
public class <ProdName> extends <BaseClass>
<ProdName> is the name of the production in the ASN.1 source file. <BaseClass> is a class from which the type is derived. This can either be a standard run-time or compiler-generated class. In our example, the EmployeeNumber is an INTEGER, so we can directly extend the Asn1Integer run-time base class. If we had a declaration such as the following:
EmployeeSSNumber ::= [APPLICATION 22] EmployeeNumber
Our EmployeeSSNumber class would be derived from the compiler-generated EmployeeNumber class as follows:
public class EmployeeSSNumber extends EmployeeNumber
Note: the preceding example is not true if –compact is specified. In that case, all intermediate classes would be removed so EmployeeSSNumber would extend Asn1Integer as in the first case.