In Example 15-1, the public modifier needs to be added to all the methods for the class. The online code is correct.
The javareg.exe tool does not literally create a DLL -- what it does is register the Java class and assigns msjava.dll to act as surrogate for the Java class.