tailieunhanh - The C# Programming Language phần 3

nó đã được chuẩn hóa ECMA và ISO / IEC, và sự phát triển của một phiên bản thứ hai của ngôn ngữ với một số tính năng chính mới là gần hoàn thành. Cuốn sách này là một đặc điểm kỹ thuật đầy đủ của ngôn ngữ lập trình C #. Cuốn sách được chia thành ba phần. Phần I, C # , "bao gồm các chương 1-18 | Types and Variables Category Bits Type Range Precision Unsigned integral 8 byte 16 ushort 535 32 uint 294 967 295 64 ulong 446 744 073 709 551 615 Floating point 32 float X IO-45 to X 1038 7-digit precision 64 double X 10-324 to X IO308 15-digit precision Decimal 128 decimal X 10-28 to X 1028 28-digit precision 1. Introduction C programs use type declarations to create new types. A type declaration specifies the name and the members of the new type. Five of C s categories of types are user-definable class types struct types interface types enum types and delegate types. A class type defines a data structure that contains data members fields and function members methods properties and others . Class types support inheritance and polymorphism mechanisms whereby derived classes can extend and specialize base classes. A struct type is similar to a class type in that it represents a structure with data members and function members. However unlike classes structs are value types and do not require heap allocation. Struct types do not support user-specified inheritance and all struct types implicitly inherit from type object. An interface type defines a contract as a named set of function members. A class or struct that implements an interface must provide implementations of the interface s function members. An interface may inherit from multiple base interfaces and a class or struct may implement multiple interfaces. An enum type is a distinct type with named constants. Every enum type has an underlying type which must be one of the eight integral types. The set of values of an enum type is the same as the set of values of the underlying type. A delegate type represents references to methods with a particular parameter list and return type. Delegates make it possible to treat methods as entities that can be assigned to 9 1. Introduction 1. Introduction variables and passed as parameters. Delegates are similar to the concept

TỪ KHÓA LIÊN QUAN