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 trialA X
12,842 PointsVocab 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
231,248 PointsPerhaps these descriptions and examples will help:
- Declaring a Variable Identifying both the type and name of a variable
int status;
- Assigning a Variable Giving the variable a value
status = 23;
- Initializing a Variable Assigning for the first time, may also include declaring.
- String Literal A string value that's not a variable
"You win!"
- Integer Literal An integer value that's not a variable
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
1,315 PointsHans Eisenman
1,315 PointsThese are much better than the definitions in the original video, IMO. They give more context and specificity. Thanks!