title: Call a separate Java class to set up or change data without asking for a return or setting up an object
body: <p>I'm trying to split a java program into .java files which are called from the main class:</p>
  
  <pre><code>public static void main(String[] args) { 
  //Call code in a separate .java file which sets up an array of objects.
  //Call code to change the object values in a certain way i times
  //Call code to do some calculations
  //Call code to display some info
  }
  </code></pre>
  
  <p>All the guidance I have come across which is broadly analogous to calling a separate piece of code to do something refers to either creating objects (eg <code>MyObject myobject1 = new MyObject();</code>); or getting returned values (eg <code>x=myMethod(datain);</code>), rather than simply creating or changing data.</p>
  
  <p>Have I missed something, or is there no way to avoid putting all the creating/changing code in the same main .java file without artificially creating objects or getting pointless returns such as <code>Boolean datacreated = createMyData()</code></p>
  
  <p>In my simple Fortran derived world I would be able to split up the main program as follows: </p>
  
  <pre><code>call SetUpMyData
  call ChangeMyData
  call SomeOtherSub
  //etc
  </code></pre>