how to store if statement result in an array
<p>how to have these string values in an array. its giving me the output loc[j]==1 is simple loc[j]>1 is extended. but am storing this in string.. i need to store these values in string array . how do i do it</p>

<pre><code>      String s = (loc[j]==1 ? "simple" : (loc[j]&gt;1 ? "extended" : null));
</code></pre>

<p>this is equivalent to this code</p>

<pre><code>          if(loc[j]==1)
         System.out.println("Simple");
         else
           System.out.println("extended");
</code></pre>
