A method without parameters is calling for an argument

后端 未结 2 926
野的像风
野的像风 2021-01-27 15:13

I have a class named Location that has several methods in it that do not have any parameters.

However, when I try to create a variable with the result of th

2条回答
  •  囚心锁ツ
    2021-01-27 15:45

    Because you're trying to call it as a class function. You should be creating an instance of Location and calling the function on that. Note also that it returns String Where your code is telling the compiler you're expecting it to return a Location.

提交回复
热议问题