I Want to store the reversed string a in b without any function.
public static void main(String args[])
{BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String a=br.readLine(); String b; for(int x=0,y=a.length()-1;x<a.length();x++,y--) { b.charAt(x)=a.charAt(y); }
But I get this error :
b.charAt(x)=a.charAt(y); ^required: variable
found: value
1 error
Can you explain it and help me fix it ?
You could just do