Variable is a name for a memory location that can store data of different types. There are three types of variables in Java: local variables which are declared within methods and can only be used locally, instance variables which are declared within a class but outside methods and can be accessed by any instance method, and static variables which have a single copy shared among all instances of a class.