title: Is it possible to loop different variables with same names but different numbers?
body: <p>Basically what i want to do is print the value of 4 variables: x1, x2, x3, x4. Is it possible to do something like an array? I want to do this without putting them into an array because i have a lot of variables, sorta inefficient. Something like this? I know this is a dumb question but i wanted to know if there was a more efficient way to do this :P</p>
  
  <pre><code>for(int i = 0; i&lt;4; i++){
       System.out.print(x(i));
  }
  </code></pre>