‹ Back to the paper
Question 1(x)
1 mark
Computer ScienceISC 2024 Computer Science Paper 1Short answerMethods
Answer the following.
State any one difference between instance variable and class variable.
Answer
Answer
An instance variable is declared inside a class without the
static keyword, and each object of the class gets its own separate copy of it. A class variable is declared with the static keyword, and only one copy of it exists, shared by all objects of the class.