DOT NET QUESTIONS
1
What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why.
In interface all the methods are abstract and there is no implementation, where as in an abstract class, we can have methods that are defined concrete with implementaion. In interface, we cannot specify any access modifiers, where as in abstract class these modifiers can be specified
2
What's the difference between a label and a literal?
A label when displayed as an HTML page in the client browser is converted into DIV tag where styles can be applied, but in case of Literal it is plain string and no styles can be applied for it.
3
How do we get a file dialog to upload a file in asp.net ?
Using File Field control (HTML Control)
4
What is serialization in .Net?
It is process of converting an object into a stream of bytes. These stream of bytes are in a seralized format, these can be transmitted in a different context (say another machine). This format can be understood the destination machine and the original object can be rebuilt.
5
What is CLR?
CLR is common Language Runtime. It basic tasks are compiling from MSIL to native code, memory allocation, deallocation, multi threading, debugging facilty, marshalling the code, type checking.
6
What are the components in .Net framework?
Languages like VB.Net, C#,. WEB FORMS, WINDOWS FORMS, ASP.NET, CLR, Type Library, VS.Net
7
How is garbage collection implemented in .Net?
GC is a low priority thread running in the application. It will check for the unused resources periodically and release them from memory. In the process, the heap is divided into 3 parts called Generations. Generation 0 contains the recently created objects. GC finds the unreachable objects and collects them(releases them). Then the reachable objects from Generation 0 are compacted and sent to Generation 1. In this way, the GC operates.
8
What is the difference between the Dispose and Finalise methods (CTS)?
GC release the memory for the objects created by the application. But it has no control over the network resources like file opened, network connection opened etc., To release these resources we have to explicitly call the Dispose method for the respective objects. This explicit clean up code can also be written in the Finalise method. Even if the client forgets to call the Dispose method, the Finalize call is made implicitly by the compiler itself. These two methods (Dispose and Finalise) are called as Finalizers. Note: Finalise in VB.Net is similar to destructor in C#
9
What are the ways in which the Dispose method can be implemented?
The user of the class can call Dispose directly or he can put the call to Dispose in the Finalise method. The difference is when the user calls dispose from outside, the unmanaged and managed ode gets cleaned up. If it from the Finalise, only managed code gets cleaned up.
10
What is managed code?
The code that runs in the .Framework and that is created and destroyed by the Garbage collector.
11
What are managed classes?
The classes that runs in the .Framework and that are created and destroyed by the Garbage collector.
12
Whats the need for GC.SupressFinalise()?
When a dispose tries tp clean the objects that are already finalised, then the finalisation fails. For avoid these exceptions, we should call the GC.SupressFinalise(Me) from the Dispose method of the class
13
What is a .Net assembly?
An assembly is an unit of deployment in .Net framework. It can be an exe or a .dll. It contains the MSIL code, metadata(manifest).
14
What is a assembly manifest?
Assembly manifest contains the assembly metadata. It includes the version information, other dependant assemblies on this assembly, security information, resources required by the assembly.
15
How .Net solves the DLL hell problem?
The .Net framework allows different versions of an assembly to run on the same machine at the same time. This was not allowed by using COM as it requires component registrations. This problem was solved by .Net.
16
What is a NAMESPACE?
A set of related classes grouped together is called as a NAMESPACE.
17
What are different types of assemblies?
An assembly can be statis or dynamic. A static assembly is one that contains types, resources and interfaces. It is in the form of exe / dll and it stored on the hard disk in the portable executable format.On the other hand, dynamic assemblies are not stored on the hard disk but they can be created dynamically when ever an assembly requires some types in the runtime. To create dynamic assemblies, the System.Reflection.Emit namespace is used.
18
What are private and shared assemblies?
A private assembly is an assembly that is used by a single application. A shared assmebly is that one that is used by more than one application. It is put in GAC and this assembly needs a strong name for the addition into GAC. Use Control Panel + Administrative tools + Microsoft .NET Framework 1.1 Configuration
0 Comments:
Post a Comment
<< Home