Namespace: It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.
Assembly: It is an Output Unit. It is a unit of Deployment & a unit of versioning.
Assemblies contain MSIL code.
Assemblies are Self-Describing. [E. g. metadata, manifest]
An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deploymed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.
Monday, May 31, 2010
'USING' keyword in C#
USING as Directive- Using keyword is used for importing namespaces to our classes.
USING Block- If you declare any unmanaged object in 'USING' block, You need not explicitly dispose that object. Once the block execution is over the dispose() will be called automatically.
USING Block- If you declare any unmanaged object in 'USING' block, You need not explicitly dispose that object. Once the block execution is over the dispose() will be called automatically.
What is the difference between Server.Transfer and Response.Redirect?
Server.Transfer(): Using this statement it not only redirects to the next page but also all the content of the page is transferred to next page. Data is persisted to next pages using Context.ItemCollection which keeps the page state alive.
Response.Redirect(): Using this statement the Context.Items loses the persistence to transfer the content to next page. Hence every page is treated as a seperate page.
Response.Redirect(): Using this statement the Context.Items loses the persistence to transfer the content to next page. Hence every page is treated as a seperate page.
What is the difference between a value type and a reference type?
Value types are stored on the stack and reference types are stored on the heap. Value types are primitive data types such as int, char and float. Reference types are data types such as class, interface, event and delegate.
Saturday, May 29, 2010
What are Delegates?
Delegates are like function pointers in C/C++ but with the added benefit of being type safe. You use delegates to call the methods of other objects. They are object-oriented function pointers since they allow a function to be invoked indirectly by using a reference to the function.
What is versioning in .net
.Net has an Assembly. Assembly is a single unit of deployment. Assemblies are used to maintain .dll's and .exe's. If there is a modification in the code then it is difficult to find out which was the modified code. In order to overcome this problem versioning was implemented in Assemblies. Hence versioning came into existence.
Friday, May 28, 2010
What are valid signatures for the Main functions
Static void Main(string[] args)
Public static void Main(string[] args)
Static Public void Main(string[] args)
Public static void Main(string[] args)
Static Public void Main(string[] args)
Subscribe to:
Posts (Atom)