NET Interview Summary topics

Source: Internet
Author: User

Prepare for the interview topic.

1.private, protected, public, internal access rights?

Private: A privately owned member that can be accessed within a class.

Protected: A protected member that can be accessed within the class and in the inheriting class.

Public: Common members, completely public, without access restrictions.

Internal: can be accessed within the same namespace.

2. List several ways to pass between ASP.

Quertstring

1, such as Response.Redirect ("Target.aspx?param1=liupan")
Receive page: string str = request.querystring["param1"];

2.Session (Session exists on the server side and is commonly used for logon authentication functions.) Session variable if storing too much data consumes too much server resources)

Set such as session["name"]= "Liupan" to get string name = Session[name]. ToString ();

3.Cookie (Cookie exists on client)

Set HttpCookie name= new HttpCookie ("name"); Name. Value = "Liu"; Reponse.appendcooke (name); Gets the string name = Request.cookie[nam]. Value.tostring ();

4.Application (The Application object is scoped to the entire global, meaning it is valid for all users.) This method is not used very often, because application is shared in an application domain, and all users can change and set their values, so only apply the counters, etc. where global variables are required. )

Setting: application["name"] = = "Liupan";
Get: String name = application["Name"]. ToString ();

5.Server.Transfer

3.Readonly with const difference

First, explain what the static constants are and what the dynamic constants are. A static constant is a compiler that parses a constant at compile time and replaces the value of the constant with the initialized value. While the value of the dynamic constant is obtained at the moment of operation, it is marked as a read-only constant during compiler compilation, instead of the constant value, so that the dynamic constant does not have to be initialized at the time of declaration, but can be deferred to the constructor initialization.

1) const-modified constants must be initialized at the time of Declaration; readonly-Modified constants can be deferred to constructor initialization

2) const-modified constants are parsed during compilation, that is, constant values are replaced with initialized values; readonly-Modified constants are deferred until run time

In addition, const constants can be declared either in a class or within a function body, but static ReadOnly constants can only be declared in a class.

In 4.c#, the difference between a value type and a reference type

All value types in C # are implicitly derived from System.ValueType:

Value types: Sbyte,byte,short,int,long,datetime,ushort,unit,ulong,char,float,double,decimal,bool,struct,enum, and nullable types

Reference types: Arrays, classes, interfaces, delegates, object,string

Instances of value types are stored on the stack, but when an instance of a class has a field that is a value type, the actual field is kept in the same place as the instance of the class, on the heap.

What is the difference between 5.string and string?

Http://www.microsoftvirtualacademy.com/training-courses/twenty-c-questions-explained-cn


NET Interview Summary topics

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.