हम ज्ञान और हमारे ध्यान की जांच करते हैं। जावा कोड दिया गया:
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
public class Foo { private static Foo instance = new Foo(); private static final int DELTA = 6; private static int BASE = 7; private int x; private Foo() { x = BASE + DELTA; } public static void main( String ... argv) { System. out .println(Foo.instance.x); } }
ध्यान दें सवाल! क्या प्रदर्शित किया जाएगा? और सबसे महत्वपूर्ण बात - क्यों?
UPD सावधानी - सही उत्तर पहले से ही टिप्पणियों में है। मैं आपको अन्य पीएल में एक परीक्षा आयोजित करने और टिप्पणियों में परिणाम देने के लिए कहता हूं।