. NET Knowledge Point Rollup

Source: Internet
Author: User
Tags closing tag null null server memory wsdl

What are the necessary conditions for deadlocks? How to overcome?

A: The system's resources are insufficient, the process of advancing the order is inappropriate, the resource allocation is not appropriate, a resource can only be used by a process at a time, a resource request resources, and at this time this resource has been blocked, to have access to resources, process access to resources, not used until the end, can not be forcibly deprived.

Interface can inherit interfaces? Can an abstract class implement an interface? Can abstract classes inherit entity classes?

A: An interface can inherit an interface, an abstract class can implement an interface, an abstract class can inherit an entity class, but there is a condition that the entity class must have a definite constructor.

Can the constructor constructor be inherited? Is it possible to override?

A: constructor can not be inherited and therefore cannot be rewritten (overriding), but can be overloaded (overloading).

When a thread enters the method of an object, does the other thread have access to the object's method?

A: No, the method of an object can only be accessed by one thread.

Can C # operate directly on memory?

Answer: This question is more difficult to answer, but also a big problem. But you can ask questions like this.

C # is the ability to directly manipulate memory, although very few pointers, but C # can use pointers, in the use of the need to add unsafe, in. NET using the garbage collection mechanism (GC) feature, which replaces the programmer, but in C # can not directly use the Finalize method is a finalize () method that calls the base class in a destructor

Is there a difference between error and exception?

Answer: Error means recovery is not impossible, but difficult, exception represents an actual or implementation problem, it indicates that the program is not working properly can not happen

Talk about the difference between final,finally,finallize?

A: Final is used to declare properties, methods, and classes, to indicate that properties are immutable, that methods cannot be overwritten, that classes cannot be inherited

Finally is the exception-handling statement structure that represents the part that is always executed.

Finallize represents a method of the object class that is invoked when it is executed in the garbage collection mechanism.

The difference between HashMap and Hashtable?

A: HashMap is a lightweight implementation of Hashtable, non-thread-safe implementation They all implement the map interface, the main difference is that the HashMap key value can be null NULL, efficiency can be higher than Hashtable.

The difference between collection and collections?

A: Collection is the parent interface of the collection class, and collections is a helper class for the collection class, which provides a series of static methods for searching, sorting, and threading security for various collections.

What is a delegate in C #? is the event a delegate?

A: A delegate is a secure similar to a function pointer, but she is much more secure than a pointer, and it can pass a method as a parameter to another method, which can be understood as a reference to a function. An event is a message mechanism, which is a delegate that delegates without a method body

Override,overload, the difference?

A: Override is the overriding meaning, which represents the method of overriding the base class, and the name of the method, the return type, the parameter type, and the same number of arguments as the base class

Overload is the meaning of overloading, and it also represents the method of overriding the base class, but as long as the method name is the same, the other can be different

When you need to pass variable values in a BS structure, you can't use Session,coolke,application, how many methods do you have?

Answer: this.server.transfer,querystring

is the indexer implementation process in C # only based on a numeric index?

Answer: No, it can be any type.

What is the meaning of the two keywords using and new in C #, please write what you know? Using

Directive and statement new Create instance new hides the base class method.

A: Using introduces namespaces or uses unmanaged resources

New instance or hide parent method

How many ways does new have to use?

A: There are 3 kinds, the first is, the instantiation of such as: Newclass ()

The second is that public new hides the base class method

The third is that any type parameter in a generic class declaration must have a public parameterless constructor

Overview of reflection and serialization?

A: You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get a type from an existing object type, and then invoke the method of the type or access the fields and properties.

Serialization: The process of converting an object into a format transmitted by another medium. For example, serializing an object, passing the object between the client and the server over the Internet with HTTP, and re-obtaining the object from the stream at the other end with deserialization.

Const and readonly?

A: const is used to declare constants when programming, and ReadOnly is used to declare a running constant.

What are the similarities and differences between UDP and TCP connections?

A: TCP is a Transmission Control protocol that provides connection-oriented, reliable, byte-stream services that, when users and servers interact with each other, must make a TCP connection before they can transfer data. TCP provides time-out redial to verify the data function.

UDP is a User Datagram protocol, is a simple datagram-oriented transport protocol, is unreliable connection

How do processes and threads understand each other?

A: The process is larger than the thread of the program to run the unit, are the operating system realized by the operation of the unit, a program must have at least one process, there is a process,

At least one thread, the scale of the thread is smaller than the process, the process has a separate memory unit, the thread is shared memory, which greatly improves the program's operational efficiency

Multiple threads in the same process can execute concurrently.

Asp. NET pages to pass values between the several ways?

Answer: Querystring,session,cookies,application,server. Transfer,respose.redictor.

Please describe the methods used to pass parameters between pages in. NET, and say their pros and cons.
1.QueryString transmits one or more security requirements that are not high or simple in structure. But you can't use this method for passing arrays or objects.
2.session (ViewState) is simple, but easy to lose action on the user's personal, excessive storage will lead to exhaustion of server memory resources.
A 3.application object is scoped to the whole global, which means it is valid for all users. Its usual method is to use lock and unlock
4.cookie is simple, but may not be supported, may be forged cookies are stored on the client, and the session is stored on the server side. And the use of cookies should be used in conjunction with the ASP.
5.input ttype= "hidden" simple, may be forged
6.url parameter is simple, display in the address bar, the length is limited

What is an application domain? What is managed code? What is a strongly typed system? What are crates and unboxing? What is overloading?

What the CTS, CLS, and CLR do separately

Explain? A: Application domain: Is the isolation boundary provided for security, reliability, isolation, and versioning, and uninstallation programs. It is typically created by the runtime host and applied

The program domain provides a more secure, more versatile processing unit. Managed code: code written using the CLR compiler language editor is called managed code. Boxing and unpacking: The process of converting a value type to a reference type is implicit, and the reverse process is unpacking, which is explicit. Cts

is a public type system, the CLS is the common language specification, and the CLR common language runtime. Strongly typed systems: Each variable and object must have a declaration type

What are the authentication methods for ASP.

Answer: Windows,forms,passport

What is the difference between a value type and a reference type?

A: The value of a value type is stored in the stack, changing its value, does not change the original value of the variable, and the value of the reference type is stored in the stack, the address of the reference is stored in the stack, changing its value will change the value of the original variable. Value types are not allowed to contain null values, but nullable types can assign null to value type L

Explain the meaning and role of UDDI and WSDL.

A: UDDI is a unified description of the integration protocol, a set of Web-based, distributed, implementation standards for information registration for Web services, as well as protocol standards that are also registered for the Web services provided by the enterprise itself to enable other enterprises to discover and access. Provides standards-based specifications for describing and discovering services, and provides a set of Internet-based implementations. WSDL This is an XML-based interface that describes Web services

What is SOAP?

A: The simple access Protocol. is a protocol that exchanges information and implements remote calls in a distributed environment. is an XML-based protocol. Soap can be used regardless of any transport protocol, but it is usually an HTTP protocol that allows any type of object or code to communicate with each other in any language on any platform. It's a lightweight protocol.

How do you understand the garbage collection mechanism in. NET?

For:. NET garbage collection mechanism is the reference program to the memory collection and release. Each time an object is created with the new keyword, the runtime allocates memory from the managed heap because the space is limited and the final garbage collection mechanism is to reclaim unused memory. Memory has been freed and reused.

The object that can be accessed with foreach traversal needs to be implemented?

A: You need to implement the IEnumerable interface and the GetEnumerator () method.

What is the difference between heap and stack?

A: Heap is heaps, space is allocated and freed by manual operations, and it has a large storage area of free storage.

Stack is a stack, which is automatically allocated and released by the operating system, and the space on the stack is limited. During compilation, variables and functions allocate memory on the stack, and the pass-through of parameters at runtime function calls is performed on the stack.

Describes the access rights of private, protected, public, and internal modifiers.

For. 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.

Do you programmatically implement a bubbling sorting algorithm?
For:

int[] Array =New int[*] ;inttemp =0 ; for(inti =0; I < array. Length-1; i++){ for(intj = i +1; J < Array. Length; J + +){if(Array[j] <Array[i]) {Temp=array[i]; Array[i]=array[j]; Array[j]=temp; }}}

Ask the value of the expression below to write one or more of the implementations you think of: 1-2+3-4+......+m
For:

int  This . TextBox1.Text.ToString (); int 0  ;  for (int01 ; i++) {if(i%21+ = I ;} Else  = Sum- I;}} System.Console.WriteLine (Sum.tostring ()); System.Console.ReadLine ();

What classes are needed to read and write databases in net? Their role?

Answer: DataSet: Data memory.

DataCommand: Executes the statement command.

DataAdapter: The collection of data, the term padding.

What are the common methods of calling WebService?

Answer: 1. Use the WSDL.exe command-line tool.

2. Use the Add Web Reference menu option in Vs.net

In C #, string str = null with string str = "" Try to use text or diagrams as much as possible

As a description of the difference.

A: string str = NULL is not to allocate memory space to him, and string str = "" Assigns it

Memory space with an empty string length

Briefly talk to you about Microsoft. NET architecture, remoting and webservice two technologies

Applications in practice.

A: WS is primarily available with HTTP, penetrating firewalls. and remoting can use TCP/IP, binary

Delivery to improve efficiency

try{} has a return statement, the code in the finally {} immediately following the try

is not executed, when is it executed, before or after the return?

A: It executes and executes before return.

What is the major bug in the session, and what methods does Microsoft propose to solve?

A: IIS because of the process recycling mechanism, the system is busy, the session will be lost, you can use Sate

server or SQL Server database storage session This is slow and cannot be

Captures the end event of the session.

What is the difference between a DataReader and a dataset?

A: One is a forward-only read-only cursor, and one is a virtual database in memory.

65. What is a virtual function? What is an abstract function?

A: virtual function: A function that is not implemented and can be inherited and overridden by a subclass. Abstract function: Specify its non-virtual

A subclass must implement a function that must be overridden.

The difference between property and attribute in C #, what they are useful for, the benefits of this mechanism

Where is it?

A: A property, a field for accessing a class, an attribute that identifies a class, a method, etc., an additional

Properties

The main difference between XML and HTML

Answer: 1. XML is case-sensitive, and HTML is not distinguished.

2. In HTML, if the context clearly shows where the paragraph or list key ends, you can

Omit end tags such as </p> or </li>. In XML, you must never omit the end tag.

3. In XML, an element that has a single tag without a matching closing tag must use one/character as the

End. This way the parser knows not to look for the end tag.

4. In XML, attribute values must be enclosed in quotation marks. In HTML, the quotation marks are available for use.

5. In HTML, you can have a property name without a value. In XML, all attributes must have a corresponding

The value

What's wrong with operator declaration and only declaring = =?

A: Do you want to modify both Equale and Gethash ()? "=" must be overloaded with "! =" overloaded

Can the overloaded method change the type of the return value?

A: The overloaded method is to change the type of the return value.

What are the value types and reference types in C #?

Value types: struct (numeric type, bool type, user-defined struct), enum, nullable type.

Reference type: array, user-defined class, interface, delegate, object, String.

Why does the GUI not support cross-thread access to controls? How do you usually solve this problem?

Because GUI applications introduce a special threading model, the threading model does not allow other child threads to access UI elements across threads in order to ensure thread safety of the UI control. The solution is still more, such as:

    • Using the methods provided by the UI control, WinForm is the Invoke method of the control, and WPF is the Dispatcher.invoke method of the control;
    • Use BackgroundWorker;
    • Use the GUI threading model's synchronization context SynchronizationContext to submit UI update actions
Describe the difference between a background thread and a foreground thread?

The application must run out of all foreground threads to exit, or actively end the foreground thread, the application ends regardless of whether the background thread is still running, and for a background thread, the application can exit without considering whether it has finished running, and all background threads will automatically end when the application exits.

By setting Thread.IsBackground to True, you can designate a thread as a background thread, and the main thread is a foreground thread

Lock why do I have to lock a parameter and not lock a value type? What are the requirements for this parameter?

The lock object for lock requires a reference type. She can lock the value type, but the value type will be boxed and the object will be different after each boxing, causing the lock to be invalid.

For lock lock, the locked object parameter is the key, the synchronization index block pointer of this parameter will point to a real lock (synchronous block), this lock (synchronous block) will be reused.

What is the relationship and difference between multithreading and asynchrony?

Multithreading is one of the main ways to implement Asynchrony, and async is not the same as multithreading. There are many ways to implement asynchrony, such as the use of hardware features, the use of processes or fibers, and so on. There are many asynchronous programming support in. NET, for example, many places have begin***, end*** method, is a kind of asynchronous programming support, some of her internal use of multi-threading, and some of the use of hardware features to implement asynchronous programming.

What are the advantages of the thread pool? And what are the deficiencies?

Pros: Reduce the overhead of thread creation and destruction, reuse threads, and thus reduce the performance penalty for thread context switching, where fewer threads are more conducive to GC recycling efficiency when GC is recycled.

Disadvantage: The thread pool cannot have more precise control over a thread, such as knowing its running state, or the priority of the thread, the task (method) joined to the thread pool cannot have a return value, and the task that needs to run for a long time is not suitable for the thread pool.

. NET Knowledge Point Rollup

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.