title: How do I initialize a float array, with variable lengths, inside the code, but with the same start and end values?
body: <pre><code>PdfPTable table = new PdfPTable(new float[]{4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2});
  </code></pre>
  
  <p>This is the initializer I currently use. </p>
  
  <p>It's for a scorecard in Disc Golf, using integers to tell how wide each cell should be, but some courses have different numbers of holes (9, 18 ,24, etc). The array MUST start with a 4, for the players name, and MUST end with a 2, for totals. All cell values for individual holes are set at 1. I want to save code by using a variable in the initializer. Any help would be awesome!!</p>