This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Because You wany to print the value before initializing array object. Thats it.
Best Regards,
Rushikesh Wagh
SCJP 1.4 (2005)
SCJP 1.6 (2010)
Amieya Prabhaker
Ranch Hand
Joined: Apr 23, 2006
Posts: 45
posted
0
There's a subtle terminology: Array objects are automatically initialized with default values.
What's missing here is "instantiation" not initialisation.
Amirr Rafique
Ranch Hand
Joined: Nov 14, 2005
Posts: 324
posted
0
Array elements get their defualt value when array is initialized. when we declare array i.e. int [] x; it is null a this moment. When we say x = new int [6]; now all the 6 elements of array will get thier defualt value
"Know where to find the solution and how to use it - that's the secret of success."