The string "displayed" are filled with * and its just as long as the string "secret". and secret is a word from an array.
public void replace(String input)
{
for (int j = 0; j < displayed.length(); j++)
{
if (input.charAt(0) == secret.charAt(j))
{
displayed1 = displayed.replace(secret.charAt(j), input.charAt(0));
//System.out.print(input.charAt(0) == secret.charAt(j) ? input.charAt(0) : "*");
}
}
System.out.println(displayed1);
when i run this its gives me only *, it doesnt replace the * with the input. but if let print it, it replaces it..
im fairly new at programming, so it might be a stupid little thing as allways, but i cant find it :(