السلام عليكم
سؤال بسيط لكنه حيرني لما لاتقبل المدوده aMethod الرجوع متغير من نوع static
حيث انه عند ازاله الكلمه المحجوزه static ينفد الكود؟
class Test21 {
public int aMethod(){
static int i = 0;
i++;
return i;
}
public static void main(String args[]){
Test21 t = new Test21();
t.aMethod();
int j = t.aMethod();
System.out.println(j);
}
}.jpg)