このコードがあるとしましょう
public static long number;
public static void main(String args[]) {
String str1 = args[0];
System.out.println("str1 is = " + str1);
long number = Long.parseLong(str1);
System.out.println("number value is = " + number);
}
public static void test1(){
System.out.println("number value inside test1 is = " + number);
}
引数として 12345 を渡すと、o/p は次のようになります。
str1 is 12345
number value is 12345
number value inside test1 is 0
私が望むのは、arg[0] (ユーザー引数) または test1 メソッド内の数値 (12345) の元の値にもアクセスできるようにすることです。Plsは私がそれをするのを手伝ってください. ありがとう。!