What are the instance and class variables? ..
Answers
Answered by
1
Answer:
Class variables are those variables which are assigned / declared inside the class but outside any method/function..
whereas instance variables are those which are declared and assinged a value inside a method/function of a class..
Explanation:
hope it helps.. please mark as brainliest
Answered by
1
✓✓An instance variable is similar to a class variable. An instance variable is a variable which is declared in a class but outside the constructor and the method/function. Instance variables are created when an object is instantiated, and are accessible to all the methods, the constructor and block in the class.
Attachments:
Similar questions