Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microsoft C# Professional Projects - Premier Press.pdf
Скачиваний:
177
Добавлен:
24.05.2014
Размер:
14.65 Mб
Скачать

66

Part II

HANDLING DATA

 

 

 

Executing a C# Program

After compiling the C# program, you need to execute the program. For executing a program, click the Start command in the Debug menu.

An example of executing a C# program is shown in Figure 3-4.

FIGURE 3-4 Executing a C# program

Summary

In this chapter, you learned about the components of C#. These components include classes, namespaces, structs, enumerations, and interfaces. A class is defined as a data structure used to create objects. The instance of a class is called an object. Next, you learned about the methods used in classes. A method is a logical section of code that can be used to perform a specific operation. A method has a return type or can be of the type void.

Another important component of C# is a namespace, which is a container used to logically group similar classes. C# also includes structs, which are data structures containing constructors, constants, variables, methods, indexers, properties, operators, and nested types. You also leaned about enumerations, which are data structures that store values with user-friendly names. You also learned about interfaces, which are components used to declare a set of methods. However, the data members of the interface are not implemented. Finally, you learned to write, execute, and compile a simple program in C#.

Chapter 4

More about Components