我需要用*和空格填充数组,这是我到目前为止所拥有的
/*
* sets this.phrase array to the passed input
* creates this.maskedPhrase array and
* fills this.maskedPhrase with * or space characters
*/
public void setGame(char... input)
{
this.phrase = input;
this.maskedPhrase = new char[input.length];
for(int i = 0; i < this.maskedPhrase.length; i++){
this.maskedPhrase[i] = input[i];
}
System.out.println("IMPLEMENT setGame method");
}
答案 0 :(得分:1)
我认为,根据上下文,您应该用maskedPhrase
或'*'
填充' '
(不是 复制 { {1}}至input
)。喜欢,
maskedPhrase