i have a code:
package Main;
public class Rotation {
public static void main(String[] args) {
StringBuilder str=new StringBuilder("ABCD");
for (int i = 0; i < str.length()-1; i++) {
char temp=str.charAt(0);
for (int j = 0; j < str.length()-1; j++) {
str.charAt(j)=str.charAt(j+1);
}
}
}
}
and it gives me error at
str.charAt(j)=str.charAt(j+1)
i want to assign it?
did any one has solution?