Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reassigning

 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int [] dots = new{3,4,5};
int [] sec = new{5,6,7};
dots =sec;
Is this okey? Truely what's happens here?
What happen to array hold(3,4,5) elements?
 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not OK unless you remove 'new'

try this and see the output...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic