Question OOP-CLS-0013
MediumWhat is the difference between a class variable and an instance variable?
- A.
There is no difference
- B.
Instance variables are shared by all objects
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Classes and Objects question
What is the difference between a class variable and an instance variable?
There is no difference
Instance variables are shared by all objects
Sign up free to see the answer and a step-by-step explanation.
Class variables can only be strings
A class variable is shared by all instances; each instance has its own copy of an instance variable