Three. Net classical pen questions and three. net questions that American enterprise personnel like to take

Source: Internet
Author: User

Three. Net classical pen questions and three. net questions that American enterprise personnel like to take

1. Evaluate the values of the following expressions and write out one or more implementation methods you have come up with: 1-2 + 3-4 + ...... + M

A:

Int Num = this. TextBox1.Text. ToString ();

Int Sum = 0;

For (int I = 0; I <Num + 1; I ++)

{

If (I % 2) = 1)

{

Sum + = I;

}

Else

{

Sum = Sum-I;

}

}

System. Console. WriteLine (Sum. ToString ());

System. Console. ReadLine ();

2. Use. net as a B/S structure system. How many layers of structure do you use to develop the relationship between each layer and why do you need to layer it like this?

A: layer by MVC

Generally Three Layers

Data access layer, business layer, and presentation layer.

The data access layer adds, queries, and modifies databases.

The business layer is generally divided into two layers. The business apparent layer communicates with the presentation layer, and the business rule layer Implements user password security.

The presentation layer adds a form to interact with users, for example, users.

Advantages: clear division of labor, clear organization, easy debugging, and scalability.

Disadvantage: increase costs.

3. In the following example

Using System;

Class

{

Public ()

{

PrintFields ();

}

Public virtual void PrintFields (){}

}

Class B:

{

Int x = 1;

Int y;

Public B ()

{

Y =-1;

}

Public override void PrintFields ()

{

Console. WriteLine ("x = {0}, y = {1}", x, y );

}

What is the output when new B () is used to create B's instance?

Answer: X = 1, Y = 0; x = 1 y =-1

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.