Summary of instance usage for classes and structs

Source: Internet
Author: User
1. What is an interface? Functional characteristics? Implementation code? An interface is a set of specifications that is defined using the interface keyword, consisting of a combination of members of a class, describing some functionality. As can be seen in C #, some of the system's interfaces are named: IComparable (Type comparison method), ICloneable (Support clone), IDisposable (freeing resources) and so on, I represents the interface, and able reflects the characteristics of the interface: "Can ... "To show what this set of specifications could do. (1), Interface implementation public interface iprintable {void printstring (); &nbs

1. C # Basic Knowledge Collation: C # Classes and structs (4)

Summary: In the Java multithreaded application, the queue usage is very high, most of the production consumption model of the first interface is defined using the interface keyword, composed of members of the class, describes a number of functions of a set of specifications. As can be seen in C #, some of the system's interfaces are named: IComparable (Type comparison method), ICloneable (Support clone), IDisposable (freeing resources) and so on, I represents the interface, and able reflects the characteristics of the interface: "Can ... "To show what this set of specifications could do.

2. C # Basic Knowledge Collation: C # Classes and structs (3)

Summary: Static classes and static members are classes or members that are defined with the static keyword, and the members of the static class must be static members, or they will get an error. One of the great features of static classes and members is that they are unique. If it is a static class, then it is not instantiated, and loaded in memory only one, if it is a static variable, the method, the class can be instantiated, no matter how many times, static variable or method is always only one.

3. C # Basic Knowledge Collation: C # classes and structs (2)

Introduction: The so-called constructor, is a method, this method can initialize the object, that is, after running the function, memory has opened up a piece of the object of the class space. There are three kinds: normal constructors, that is, instantiated constructors; private constructors; static constructors.

4. C # Basic Knowledge Collation: C # classes and structs (1)

Summary: structs are defined with struct keywords, similar to classes but intrinsically different. The structure essence is a value type and it does not need to be assigned.

5. C # Architecture and classes

Summary: Classes and structs are two basic constructs of the same type of system in the. NET framework. Both essentially belong to the data structure, encapsulating this group as a whole as a logical unit of information and behavior. Data and behavior are "members" of the class or struct, and they contain their own methods, properties, events, and so on.

6. C#.net often confusing points of knowledge

Introduction: 1, please tell me. What are the differences between classes and structs in net? A: Structs and classes have a general syntax, but structs are more restrictive than classes. Structs cannot declare a default constructor, and a copy of the struct is ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.