• Post Reply Bookmark Topic Watch Topic
  • New Topic

Differece between Initialization and Assignment  RSS feed

 
Sundaralingam Subramaniyan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

what is the difference between intialization and assignment?

kindly assist...
 
Bill Cruise
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although initialization is a type of assignment there is a small distinction between the two. Initialization occurs when a variable is declared.



Assignment happens any time thereafter. In some languages, notably C, implicit initialization doesn't happen. If I say



memory space is set aside for x, but the default value for the type is not assigned to the variable as it is in Java (so there really isn't a default value for each type in languages like C).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!