我在其他帖子中读到,System.out.println(finalPressedKey); 你应该写而不是只写System.out.println(Arrays.toString((finalPressedKey));,否则它只会返回保存字符串的位置(据我所知)。
public static String PressedKey[] = new String[2000];
public static String[][] finalPressedKey = {{ "", "", "", "", "", "", "", "", "", "", "", "" }}; // 12
public static String FPK3;
public static void upcounter(KeyEvent e) {
for (int x = 0; x < PressedKey.length; x++) {
if (PressedKey[x] != null && PressedKey[x + counter] != null) {
//FPK counter is supposed to be a line, and counter is where the words are supposed to be saved
finalPressedKey[FPKcounter][counter] =
finalPressedKey[FPKcounter] + PressedKey[x + counter];
System.out.println(Arrays.toString(finalPressedKey));
}
}
每当我按下一个按钮时,它应该保存在我的PressedKey数组中,并且 finalPressedKey 应该包含它自己,并且PressedKey(而且,应该只打印数组的最后一个元素),但它只是打印[[Ljava.lang.String;@76f42c4b]
我也尝试过使用Arrays.deepToString();,但它给了我与使用相同的输出Arrays.toString();
感谢您的帮助!
HUWWW
冉冉说
慕沐林林
蝴蝶不菲
相关分类