Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics (Retired) Console I/O Receiving Input

Vocab Review: Declaration, Assigning, and Initializing a Variable and String Literals

Just went through Jeremy's C# lecture where he discusses the following vocab terms that I should know, but I still don't:

-Declaring a Variable: Is this the process of simply giving an unique name to a variable?

-Assigning a Variable: This is the most nebulous to me, is assignment instructing the variable to do something?

-Initializing a Variable: From what I understand it's simply combining the declaration and assignment into 1 line of code?

-String Literal: When a string contains 1 value? Do literals exist in other forms? I would assume so, like Integer and Float Literals....

1 Answer

Steven Parker
Steven Parker
231,261 Points

Perhaps these descriptions and examples will help:

  • Declaring a Variable :point_left: Identifying both the type and name of a variable :point_right: int status;
  • Assigning a Variable :point_left: Giving the variable a value :point_right: status = 23;
  • Initializing a Variable :point_left: Assigning for the first time, may also include declaring.
  • String Literal :point_left: A string value that's not a variable :point_right: "You win!"
  • Integer Literal :point_left: An integer value that's not a variable :point_right: 23

An example of "initializing" that does not include declaring might be done inside a constructor to give an instance variable it's starting value.

Hans Eisenman
Hans Eisenman
1,315 Points

These are much better than the definitions in the original video, IMO. They give more context and specificity. Thanks!