There are three types of variables:
The default values for instance and static variables are the same and depends on the type:
An array is an Object. So an array instance variable that is declared but no explicitly initialized will have null value. If you declare an int[] array as instance variable it will have the null value.
Once the array is created all of its elements are assiged with the default type value. For example:
private boolean[] list; // default value is null
private Boolean[] list; // default value is null
once is initialized:
private boolean[] list = new boolean[10]; // all ten elements are assigned to false
private Boolean[] list = new Boolean[10]; // all ten elements are assigned to null (default Object/Boolean value)
That depends. Is it just a variable (in a method)? Or a class-member?
If it's just a variable you'll get an error that no value has been set when trying to read from it without first assinging it a value.
If it's a class-member it will be initialized to null by the VM.
Any object if it is initailised , its defeault value is null, until unless we explicitly provide a default value.
Source: Stackoverflow.com