java 运行出现的 空指针异常 问题求大神帮忙看一下

2025-04-16 21:00:59
推荐回答(3个)
回答1:

把错误代码贴全点,你可以自己设断点debug啊,一步步看是谁是空指针就可以了

回答2:

class CountWords {
private String text;
private String[] words;

public CountWords(String text) {
this.text = text;
words = this.text.split("[ \n\t\r.,;:!?()]");
}

Map map = new TreeMap();

public void printResult() {

回答3:

你的split用了几种分割标准啊?