class Test{
static String str[];
public static void main(String args[]){
System.out.println("args "+args);
System.out.println("str "+str);
}
}
Output
args [Ljava.lang.String;@3e25a5
str null
My doubt is ... How some object address is printing for args when it has not initialise.
In case it has got initilised ,without array size specifiction how its is possible to initialize? If i will check by printing args[0], Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 will come...
When i have printed str variable its showing null .
So I have tried by direct initialization like String str[]={};
Now by printing this str i got some address instead of null.
so what is the use of String str[]={}; without any value?