Converting String to int in java
<p>I need to convert a string to a corresponding int array in java. i wrote the following code but its not working as i expected .</p>

<pre><code>        String temp= "abc1";
        int[] intArray = new int[temp.length()];
        for (int i = 0; i &lt; temp.length(); i++) {
            intArray[i] = Integer.parseInt(temp[i]);
        } 
</code></pre>

<p>I have written an rc4 encryption program which take the key and plain text as int arrays. So I need to convert the user specified key to int array before passing it to the encryption function. Is this the correct way of using key in encryption programs? </p>
