List of article on Variables

Static Variable With Example In JAVA

Any variable when declared with the keyword “static” is known as static variable or class variable in JAVA. Static variable is used to fulfill the common properties of all objects. For example: institute name of students is common for all students so it will be declared as static variable in JAVA. The static variable gets … Continue reading Static Variable With Example In JAVA

Instance Variable With Example In JAVA

An instance variable is a variable defined in a class (i.e. a member variable) in which each instantiated object of the class has a separate copy, or instance. An instance variable is similar to a class variable. Instance variables belong to an instance of a class. It means instance variables belong to an object and we know that an object is an … Continue reading Instance Variable With Example In JAVA

Local Variable With Example In JAVA

A local variable is a variable declared inside a method body, block or constructor. It means variable is only accessible inside the method, block or constructor that declared it. Important Note: In java, a block i.e. “area between opening and closing curly brace” defines a scope. Each time you start a new block, you begin … Continue reading Local Variable With Example In JAVA

Types Of Variables In JAVA With Example

A variables can be defined as to reserve memory space to store the values. These can be initialized at the time of declaration or later on depending on the type of variable. There are basically three type of variable available in java: local variables, instance variables and static variables. Types Of Variables in JAVA: There … Continue reading Types Of Variables In JAVA With Example