non static variable cannot be referenced from a static context

前端 未结 5 986
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 05:31

I am a Java newbie, so please bear with me and help.

I aim to first play then record sound.

I use netbeans IDE 6.8. Here is the code:

import java         


        
5条回答
  •  执念已碎
    2021-01-29 06:02

    Static means that there is no object (instance of class, like new YourClass()). If you have a static function, it is supposed to be "standalone", so it cannot use non-static things, because they use stuff in a real object (like member variables etc.)

    Any static function can only call and use other static functions. So look for the trouble in that environment.

提交回复
热议问题