How to define a code snippet in Java
<p><strong>I know about <code>static final</code> equivalent to <code>#define</code> , But I am not looking for it</strong></p>

<p>I have used <code>#define REP(i,n) for(__typeof(n) i=0; i&lt;(n); i++)</code> in C++ and after that I can use <code>REP(i,10)</code> instead of <code>for(i=0; i&lt;10; i++)</code> in the whole program.</p>

<p>But is there a way to do this in Java? I want a version of <code>#define REP(i,n) for(__typeof(n) i=0; i&lt;(n); i++)</code> in Java.</p>

<p>I try it with <code>static final</code> but can't figure out.</p>
