C sharp programming for absolute beginners

    技术2023-03-19  8

    In C# programming, you have code inside methods, which are inside classes, which are inside namespaces

    In the .NET environment (of which C# is a primary language) are layers of code that go from general to specific. The outer, most general, layer is the namespace. Inside a namespace, you find

    a series of classes, which contain methods, which contain statements.

    Think of the layers as something like an address on an envelope. When you address an envelope, you write specific information, such as the house number. You also put the street name, which is more general, and the state, which is broad. The post office can deliver your letter by

    getting it to the correct state, then the correct city, then the right part of the city, and finally the specific house. Namespaces in the C# language work very much like this.

    A namespace is usually made up of one or more classes. A class is a definition for a specific kind of object.

    Anything a computer can describe (a database, a file, an image, a cow, whatever) can be encoded

    as an object. The things an object can do are called its methods, and the characteristics of an object are called its properties.