• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array's  RSS feed

 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the following two declaration statment of Array's



As first one is single dimension array and second one is multidimension array , then the reason to get confused is in the assignment of new instance type in both the array's. What's the reason of compiling the first statement of array successfully and the reason of throwing the compile time error in second statement.

Thanks in advance!

[ November 10, 2008: Message edited by: Pawan Arora ]
[ November 10, 2008: Message edited by: Pawan Arora ]
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If we break it down a bit we get the following:


If we do that for the other one you'll see why it doesn't compile.

Breaking it down:
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm glad you could read that code, Rob; I couldn't understand it.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it's creating anonymous arrays and accessing their data in one statement. Once you see that you know where to split it.
However, if I ever had a team member that wrote code like that I'd smack him / her
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
Well it's creating anonymous arrays and accessing their data in one statement. Once you see that you know where to split it.
However, if I ever had a team member that wrote code like that I'd smack him / her
Thank you, but your spelling is up the creek, Rob; there is no "m" in "sack."
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!