So I wanted to add a character to a string, and in some cases wanted to double that characters then add it to a string (i.e. add to it itself first). I tried this as shown b
String string = X + X;
Here X i'ts threated as a variable
You should use something as
String string ="x x";
Or
String x = "something";
String y = "else";
then String string= x+y;
should work just fine, this is because you are concatening with the "+" sign, you could also use
string = string.concat(x+y);
or
string = string.concat("something"+"else");