Too Long; Didn't Read
There are four different types of variables in Java based on where they are declared within a program. We will explain each of them with examples and their differences. They are called instance fields or variables because they belong to the instance of any object created from the class they're declared. They can also be declared at any position inside a class with or without an access modifier like (public, private, protected, or default (no keyword) They belong solely to the class and can only be accessed from their class.