Like standard conditional constructs in Java, many of the conditional compiler directives also make use of conditional expressions that govern their use. For example, the #if compiler directive, like itÆs Java language equivalent, the if statement, makes use of Java-like identifiers, operators, and expressions. With few differences, the same rules that govern the syntax of creating syntactically correct statements in Java also apply to the creation of conditional directives.
The primary difference hinted at above is in the use comments. For more information on using comments with conditional directives, see Proper Formatting of Conditional Compiler Directives.
Rules that apply to the use of identifiers in conditional compilation are summarized in section 3.8 of the Java language specification. The one exception to the rules documented in section 3.8 can be stated as follows:
Basically I need to say here: All rules applied to the use identifiers, operators, and expressions in the Java language, also apply to conditional directives, with one exception. Conditional directives may be up to 1024 characters in length.