. NET technical interview, written questions summary (7~12)

Source: Internet
Author: User

7. What is the difference between a property and a public field?

8, three layer architecture.

9. Unpacking and packing.

10ctsclrcls Explain separately.

The Similarities and differences of class and struct (struct) in dotnet.

the difference between a heap and a stack.

7, the attribute can be set value, the value of illegal value control, such as the age of the prohibition set to negative,

field does not have such a setting.

8. The usual three-tier architecture is to divide the entire business application into: Presentation layer (UI), Business Logic Layer (BLL), data access Layer (DAL). The purpose of differentiating layers is to: "High cohesion, low coupling." ”

Presentation layer (UI): The interface that is presented to the user, which is what the user sees when they use a system.

Business Logic Layer (BLL): Actions for specific problems,

Data access Layer (DAL): This layer of transactions directly manipulate the database, the data for the increase and deletion of each layer is a vertical relationship.

Three layer structure is a kind of n-layer structure, in general, the hierarchy between the downward dependence, the lower layer of code does not determine its interface, the upper layer of code is not developed, the changes in the underlying code will make the upper code changes together.

Benefits of three-tier architecture: Clear division of labor, clarity, ease of commissioning, and scalability

Cons: Increased costs

9. Boxing: Converting from a value type interface to a reference type; unpacking: Converting from a reference type to a value type

Analysis: The CTS (Common type System) is a common type systems that exist for application declarations and the rules that these types are required to comply with, and the type of the whole system is divided into two major classes, value types and reference types.

Everything in the CTS is an object, and all objects originate from a base class---the System object type. One of the biggest features of a value type is that it cannot be null, a variable of a value type always has a value, and in order to resolve a problem where the value type cannot be null, a unboxing boxing is introduced. Boxing is simply wrapping a value type into a reference type with a reference type, and unpacking the wrapped value type data from the reference type

10. Cts:common type System. int32,int16->int; string->string; Each language defines its own type. NET provides a common type through the CTS, and then the translation generates the corresponding. NET type.

Cls:common Language specfication Common Language Specification. different language syntax. Each language has its own syntax. NET provides the common syntax through the CLS, and then generates the corresponding in different languages. NET syntax.

Clr:common Language Runtime Common language runtime. is Gc,jit and so on. There are different CLR, equivalent to an engine that is responsible for executing IL.

11. Classes (class) can be instantiated, belong to reference types, are allocated on the heap of memory, and classes are passed by reference. struct (struct) is a value type that is allocated on the stack of memory. The structure is copied and passed, Int32,boolean and so on are the structural bodies.

12, stack is the space allocated during compilation, so your code must have a clear definition of the size of the stack, local value type variables, value type parameters, etc. are in the stack memory;

A heap is a dynamically allocated memory space during a program's run, and you can determine the size of the heap memory to allocate depending on how the program is running.

. NET technical interview, written questions summary (7~12)

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.