How do I fix the error where I cannot make a static reference to a non-static input field?

后端 未结 5 714
刺人心
刺人心 2021-01-26 22:38

I am learning java. I wrote the following code but I am getting this error \"cant make a static reference to a non static input field\" in Arrayfunction(), when I try to take in

5条回答
  •  半阙折子戏
    2021-01-26 22:57

    A non static reference is tied to the instances of the class. While all static code is tied to the class itself.

    You must add the static keyword.

提交回复
热议问题