Question #1 :
Difference between class variables and Instance Variables?
They both are member variables, meaning that both are associated with a class. Now of course, there are differences between the two:
These variables belong to the instance of a class, thus an object. And every instance of that class (object) has it’s own copy of that variable. Changes made to the variable don’t reflect in other instances of that class.
These are also known as static member variables and there’s only one copy of that variable that is shared with all instances of that class. If changes are made to that variable, all other instances will see the effect of the changes.