(Answered) Please explain variables used as well, thank youPlease explain variables used as well, thank you

Written by

in

➤ Can variables change type, and what is variable scope and lifetime?
Some languages allow variables to change type (dynamic typing), while others require a fixed type (static typing). Scope defines where a variable is accessible, such as local or global. Lifetime describes how long it exists in memory. Together, type, scope, and lifetime determine correct usage and prevent errors like name collisions or type mismatches.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *