See the difference below:
public class ClassName{
........ // declare here is instance variable, is given a default value
public static void main (
String[] args){
........ // declare here is local variable, must be initialized before use
}
public void someMethod(){
........ // declare here is also local variable
}
}
}