How to return array of Strings in java
<p>I need to initialize and return an array of Strings.
I did the following:</p>

<pre><code> public static String[]  pickString(int choice)
        {
         String pickedString[];
         if (cipherChoice==0)
         {
               pickedCipher[0]="strin1"; 
               pickedCipher[1]="strin2"; 
               pickedCipher[2]="strin3";        
         }//end if

             else  if (cipherChoice==1) 
             {
               pickedCipher[0]="strin1"; 
               pickedCipher[1]="strin2"; 
               pickedCipher[2]="strin3"; 
             }
    return pickedString;
    }
</code></pre>

<p>I get a syntax error on token return. Invalid type.</p>

<p>How can I initialize my string based on if statement and return the complete array ?</p>
