私は何度もこの問題に遭遇してきましたが、なぜそれが起こっているのか、そして「静的」が実際に何を意味するのかを学ぼうとはしませんでした。Eclipse が提案した変更を適用して先に進みました。
public class Member {
// Global Variables
int iNumVertices;
int iNumEdges;
public static void main(String[] args) {
// do stuff
iNumVertices = 0; // Cannot make a static reference to the non-static field iNumVertices
// do more stuff
} // main end
}
だから日食は私にそうするように言いますstatic int iNumVertices;
、そして私はその理由がわかりません。では、「静的」とは正確には何ですか、どのように使用され、「静的」を使用する目的は何ですか、なぜこの問題が発生するのですか?