クラスに属する変数で、インスタンス化(オブジェクトを生成)せずにアクセスできる変数です。すべてのインスタンスがその同じ変数を共有します。 簡単に言うと、静的変数はクラス全体で1つだけ存在する変数です。これを使うと、複数のオブジェクト ...
//Define static and non-static member functions. //Create instance of this class and call both static and non-static member functions. System.out.println("The value of public variable is "+a.getb()); ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する