A common class library that a. NET programmer should master (i)

Source: Internet
Author: User
Tags mathematical functions static class

Class Library is the basic of our study and development. Because I listed a number of commonly used classes, get a lot of netizens support comments. Learn these basics for a better system.

I intend to write a series of summaries. Hope to help the novice, master a lot of guidance.

The following main concerns are common classes of the system namespaces

Basic object and type classes that form the basis of the. NET Framework functionality.

Multi-purpose classes. such as array, console, and string, they are used in many different types of applications.

Important base classes, such as EventArgs, exception, and MarshalByRefObject. These classes define properties that are common to many derived classes.

The math class, which is a library containing only mathematical functions and constants.

Convert class, which provides a conversion function.

Generally, the generic is defined as a static class. In this way the whole sentence is called.

Type class

Type it represents the types declaration: the class type, the interface type, the array type, the value type, the enumeration type, the type parameter, the generic type definition, and the generic type of the open or closed construct.

A library that contains only mathematical functions and constants.

There are two ways to get a type object, either by using the GetType () method or by using the TypeOf operator. The following statement will provide a type object that represents the String class

Type type1 = Type.GetType("System.String");
Type type2=typeof(string);

The following is a simple case code

Using System;
Using System.Reflection;
Class Example
{
static void Main ()
{
Type t = typeof (String);

New type[] {typeof (int), typeof (int)});
mp;nbsp;
Substr. Invoke ("Hello, world!", new object[] {7, 5});
Console.WriteLine ("{0} returned \" {1}\ ".", substr, result);
}
}
/* This code example produces the following output:
System.String Substring (Int32, Int32) returned "world".
*/

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.