| 目次 |
|---|
|
・変数の宣言 ・サンプルソース ・実行結果 ・static変数 |
public class Test{
public static void main(String[] args) {
int a;
int b,c;
int d=2;
System.out.println(a);
}
}
public class Test{
public static void main(String[] args) {
int a=3;
int b,c;
int d=2;
System.out.println(a);
}
}
3
private static boolean flg = true;
if(flg){
//~何か実行~
flg = false;
}
例えば、上記のようにboolean型のstatic変数flgが宣言されているとします。