Reputation: 164
#define AND=&&;
public static final String AND = &&; //GIVES ERROR
i want to define the operators as normal variables names in my code same like we do in C language using #define, how do i do that in java ?
Upvotes: 0
Views: 58
Reputation: 11927
Java does not come with a preprocessor, however there are some out there such as http://code.google.com/p/pre-processor-java/. It is also possible to use C's preprocessor. However in general it is frowned upon in Java, the creators of Java purposefully left it out of the language.
Upvotes: 1