Computer Science, asked by athuljose05, 8 months ago

What is the difference between instance variable and local variable? class 9 computer​

Answers

Answered by tanisha105338
0

Answer:

Instance variables hold values that must be referenced by more than one method, constructor or block, or essential parts of an object's state that must be present throughout the class. Local variables − Local variables are declared in methods, constructors, or blocks.

Answered by archana4922
0

Answer:

(1) Class variable is declared and used with the keyword static where as instance variable is created without the static keyword .

(2) A single copy of class variable is created in the memory for a number of objects whereas a multiple copy of instance variable is created in the memory for each object .

(3) Changes

Similar questions