Hour 11. Using Constants, Data Types, Variables, and Arrays

As you write your Visual C# .NET methods, you'll regularly need to store and retrieve various pieces of information. In fact, I can't think of a single application I've written that didn't need to store and retrieve data in code. For example, you might want to keep track of how many times a method has been called, or you may want to store a property value and use it at a later time. Such data can be stored as constants, variables, or arrays. Constants are named values that you define once at design time and cannot be changed after that, but can be referenced as often as needed. Variables, on the other hand, are like storage bins; you can retrieve or replace the data in a variable as ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.