How do I convert String array into Json Array
<p>I have a string array like string[] sentences which consist of sentences one in each index like <code>This is the first message</code> in <code>sentences[0]</code> and <code>This is the second message</code> in <code>sentences[1]</code> and so on. My java code to send the information to the server for sentiment analysis is like this: </p>

<pre><code>OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());  
        out.write(
                "[ " +
                "\"Can't wait for the movie\"," +
                "\"Countdown! Only ten days remaining!\" " +
                "]");
        out.flush();
        out.close();
</code></pre>

<p>How do I replace the texts above in the code by the string array for it's length say n?</p>