我需要在方法末尾传递字符串,以便直接在主方法中打印字符串,但是当我在下面这样做时,我只收到这个 [Ljava.lang.String;@135fbaa4
public static String businessLogic(String[] words) {
for (String word : words) {
char[] arrayWordInChar = word.toCharArray();
int wordLength = word.length();
for (int i = 0, j = wordLength - 1; i < j; ) {
if (!Character.isAlphabetic(arrayWordInChar[i]))
i++;
else if (!Character.isAlphabetic(arrayWordInChar[j]))
j--;
else
swapLetters(arrayWordInChar, i++, j--);
}
arrayWordInChar.toString();
}
return Arrays.toString(words);
}
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] words = scanner.nextLine().split(" ");
businessLogic(words);
System.out.println(words);
}
}
这个问题我已经困惑了快两天了,请问是什么问题呢?
紫衣仙女
蝴蝶不菲
白猪掌柜的
缥缈止盈
相关分类