title: Can I have macros in Java source files
body: <p>In my program I'm reading integers form console many times. Every time, I need to type this line.</p>
  
  <pre><code>new Scanner(System.in).nextInt(); 
  </code></pre>
  
  <p>I'm used to C/C++ and I'm wondering if I can define something like</p>
  
  <pre><code>#define READINT Scanner(System.in).nextInt(); 
  </code></pre>
  
  <p>and then, in every place in my java program I can read form console as </p>
  
  <pre><code>int a = new READINT;
  </code></pre>
  
  <p>But I read form books Java does not support macros. </p>
  
  <p>Someone please explain me why is it so, and can I do this in  any other way.</p>