This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Dear Deepika, I don't know whether what I am going to say is right or wrong. In case I am wrong I would appreciate it if somebody corrected me. Ok, so I noticed that when you were assigning the values to the array then at that point of time you were not declaring the array. This means that you must have already declared the array and now you want to simply initialize it. Your statement was as follows:
The correct one should have been this way:
You notice the elimination of the square brackets in the second case. That should not be there when you are declaring and initializing the array differently. But at the time of declaration the square brackets are necessary.
NOTE: If what I said was correct then please post a small post saying that my solution was helpful as even I am not sure whether what I said was right.