1.. Net basic type system learning (1)

Source: Internet
Author: User

Microsoft. The core of the net cabinet is a public-type system.

Default base class for all classes of system. Object

Value Type reference type: pointer, a pointer to an object

What is packing and unpacking: mutual conversion between the value type and the reference type

Packing: Convert numeric type to reference type

Binning: Convert the reference type to the numeric type

Example: int Foo = 42;

Object bar = Foo; packing operation, no need to display and convert

Int foo2 = (INT) bar unpacking (display conversion is required) because an object can be converted to any type

 

All types of root: system. Object

All types are ultimately derived from the root class, so that each type has at least one set of common functions.

Four public methods are available for all types.

Bool equals () compares two object references to determine whether they are identical objects.

Int gethashcode () gets the hash of a specified objectCode.

Type GetType () is used in the reflection method to obtain the type information of a given object.

String tostring can overwrite the display string

Protected Methods

Void finalize () is called by the runtime environment. To clear the garbage before collection.

Object memberwiseclone indicates the "shortest copy" of the object ". If you copy a referenced object to another object, the referenced object is not copied.

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.