• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

array initialization

 
Kendall Ponder
Ranch Hand
Posts: 205
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any difference in the result of how the following code initializes array a vs. how it initializes array b? Thanks!

 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answer would be "no".

Array a uses the shortcut syntax to create and initialize an array. And array b uses the syntax to initialize an array after you declared it (or to create an anonymous array). Examples:

Hope it helps!
Kind regards,
Roel
 
Kendall Ponder
Ranch Hand
Posts: 205
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic