This also seems to workEach line of your output is the same as the previous but with one character different. Thus a StringBuilder can be used to hold the string such that it can be manipulated. The StringBuilder can be converted into a String at any point for display purposes.
StringBuilder sb = new StringBuilder("OOOOOOOOOO");
for (int i = 0; i < 10; i++)
{
sb.setCharAt(i, 'X');
System.out.println(sb);
}