Using a Variable or Array Element That Is Uninitialized and Unassigned
When we are using uninitialized variables or unassigned variables then we must know about what type of variable or what type of array we we are dealing with primitive or objects .because that time we can get diff behavior. but the java gives us a option of initializing a declared variable or leaving it uninitialized. And our behavior also depend on the variable or level at which we are declaring our variable.right now we have a two variable which are using right now .
- Instance variable
- Local variable
Instance variable is basically declared with in the class but outside any method or constructor. But in the case of Local variable its declared with in the method or in the argument list of the method.