您能告诉我如何在 GitHub 本身中从 GitHub 中删除存储库吗?所有建议都归结为转到“设置”项,但目前没有“设置”菜单项。可能与更新版本有关。
主页
/
user-378194
Сергей's questions
您能告诉我如何通过 getter/setter 在另一个类中填充私有数组吗?(使用 Arrays.fill)在一个类数组和 getter/setter 中:
private int[] attempts = new int[10];
public int[] getAttempts() {
return Arrays.copyOf(attempts, numberOfAttempt + 1);
}
public void setAttempt(int index, int number) {
attempts[index] = number;
}
在另一个类中,您需要使用 Arrays.fill 根据填充选项将此数组归零:
Arrays.fill(player1.getAttempts(), 0);
此选项不会重置阵列。
如果我像这样制作吸气剂:
public int[] getAttempts() {
return attempts;
}
然后重置工作。
但是如何通过初始的 getter/setter 来实现归零,这可能吗?
提前感谢您的回复!