• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two D array

 
Joshua Ebarvia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How come did b became a 2D array?



 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of the [] immediately after the int. Your code is the same as this:

In Java, you can put the [] either after the type or after the variable name, or you can even mix them (as happens with b above). There are historical reasons for this, Java inherited part of its syntax from C and C++.
 
Joshua Ebarvia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now I see it. Thanks

very TRICKY.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic