I recently saw the source code of the Google library Gson and saw something really strange (IMO). In the com.google.gson.internal package there are 2 classes which do begin with a “$”.
For example
public final class $Gson$Types { ... }
Does the dollar sign has a effect to development or is it just to say to outside developers something like “please don’t use cause it is a internal class”?
You can use any currency sign or continuation character in an identifier.
By using $, it suggests it is generated e.g. generated by the build, or for internal use only.
Uses for special characters in Java code
Hidden code
It only causes a problem if you have conflicts with generated classes e.g.
reports
Compiler generated classes do not start with a
$which may be reason this as done.On Windows 7, the special characters which can appear in a Class are
Other special characters are allows by Java, but not supported as file names. This may depend on the OS and possibly the language.