1.

How many copies of static and class variables are created when 10 objects are created of a class?(a) 1, 10(b) 10, 10(c) 10, 1(d) 1, 1This question was addressed to me by my school principal while I was bunking the class.My question is based upon Access Control topic in section Classes and Methods of Java

Answer»

Correct option is (a) 1, 10

The best I can explain: Only one COPY of STATIC variables are created when a CLASS is loaded. Each object instantiated has its own copy of INSTANCE variables.



Discussion

No Comment Found

Related InterviewSolutions