java issue creating float[]
<p>I am trying to create a <code>float[]</code> depending on the user selection. In the code below, the variable <code>widths</code> is not recognized outside the <code>if</code> block. How can I dynamically create a <code>float[]</code> or append a <code>float[]</code>? </p>

<pre><code>if(!dangerCheckBox.isSelected()){
    float[] widths = {100, 250, 70};
} else {
    float[] widths = {100, 250, 70, 70};
}
</code></pre>
