Programming Hub C,C++,C#,Asp.Net,Ado.Net,Java,  HTML,SQL.

This Blog Post Only Education Purpose For All Education Related Blogs and Articles Post Here.Download Free Software and Study Materials Mores..

Showing posts with label Assembly. Show all posts
Showing posts with label Assembly. Show all posts

Friday 24 April 2015

What is Assembly? with Examples

10:09:00 pm 0
What is Assembly? with Examples
+IT Programming World

What is Assembly?


Assembly is a .dll (or) .exe. It is a boundary for different classes which are there in an application.
When you compile an application, the CIL code created is stored in an assembly. Assemblies include both executable application files that you can run directly from Windows without the need for any other programs (these have a .exe file extension) and libraries (which have a .dll extension) for use by other applications.
Assembly consists more than one class. Two or more classes present in a assembly then we go for namespace.
Example:
namespace sbo
{
    public class Temp1
    {
        // Members of class Temp1
    }

    public class Temp2
    {
        // Members of class Temp2
    }
}
Namespace is a logical collection of different types. It is a boundary within the assembly.
Question: If we have two classes with same name then what will happen? Look at the following example.
namespace sbo
{
    public class demo
    {
        // Members of class demo
    }

    public class demo
    {
        // Members of class demo
    }
}
When you build this code it says The namespace 'sbo' already contains a definition for 'demo'
Note: So, if two classes are present with same name then those classes will be seperated by namespace.
Example:
namespace sbo
{
    public class demo
    {
        // Members of class demo
    }
}
namespace sbo2
{
    public class demo
    {
        // Members of class demo
    }
}

You Might Also Like

Developing Data-Centric Windows Applications using Java

Developing Data-Centric Windows Applications using Java Introduction The Core Java Programming and JDBC course provides an introd...

Unlimited Reseller Hosting