title: #define directive in Java
body: <p>I'm looking for a way to use something similar to <code>#define</code> in Java. I am aware there's no preprocessor there, but I doubt something like that can't be implemented. Ideally I'm looking for a way to translate this C++ code in Java: </p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;cstdio&gt;
  #define HelloWorld
  #define BEGIN {
  #define END }
  #define PROGRAM int main()
  #define WRITELN(a) puts(a);
  
  PROGRAM HelloWorld
  
  BEGIN
      WRITELN("Hello, World")
  END
  </code></pre>
  
  <p>Before this gets marked as duplicate I want to state that I'm looking for a way for a string constant to be defined before compilation, there are questions on this site about numerical ones, but that's not what I'm looking for. I apparently need to explain again how this question is different. The OP of the question somebody linked is asking whether <code>#define</code> in Java exists, to which the answer is no. What I'm asking is how do I declare string constants which are evaluated before compilation.</p>
  
  <p>And I'm aware as well that the use for this is limited, but nonetheless I don't see why something along the lines of <code>#define NAME Larry</code> can't be useful.   </p>