Instance variables are declared in a class, but outside a method, constructor or any block. Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.
Static(Class) variables and instance variables both are member variables because they are both associated with a specific class, but the difference between them is Class variables only have one copy that is shared by all the different objects of a class, whereas every object has it's own personal copy of an instance variable. So, instance variables across different objects can have different values whereas class variables across different objects can have only one value.