Can Anyone tell me how can i solve this Exception <pre><code>class Revers { static void temp(String k) { int x; char ch[]= k.toCharArray(); //Convert String into character char p[]=k.toCharArray(); //Convert String into character x=k.length(); System.out.println(x); for(int i=0;i&lt;x;x--,i++) { p[i]=ch[x]; `/*Exception comes here*/` System.out.println(p[i]); } } public static void main(String... s) { String g="HEllo java"; temp(g); //passig g as argument } } </code></pre>