java calling a method from another class

后端 未结 2 1236
清酒与你
清酒与你 2020-12-05 05:37

I am working on a problem and I am very stuck because I am just starting to learn java. Any help I can get to understand this would be great. I have to write a program that

2条回答
  •  没有蜡笔的小新
    2020-12-05 06:27

    You have to initialise the object (create the object itself) in order to be able to call its methods otherwise you would get a NullPointerException.

    WordList words = new WordList();
    

提交回复
热议问题