المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : what is the value of attr1



sabry
21-10-2008, 11:11 PM
Given the Java program Scope below: what is the value of attr1 after executing the following sequence?

method1(); method1(); method2();

public class Scope {
public static int attr1;
public static boolean attr2;
public static void method1() {
int number= 20;
attr1 = number;
}
public static void method2() {
attr1 = number;
}
static int number = 100;
}


please shabab , momkeen wa7eed menkom yesa3edny fe 7al haza al so2al

walahy akon mashkoor wo ad3eelo :)