.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Can we use two partial classes in different assemblies represent the same Class.

Posted By :Ravi Ranjan Kumar     Posted Date :June 16, 2011    Points :40   Category :.NET Framework 
we cannot have two partial classes referring to the same class in two different assemblies (projects). Once the assembly is compiled, the meta-data is baked in, and your classes are no longer partial. Partial classes allows you to split the definition of the same class into two files.
partial classes is a compile-time phenomenon, not runtime. Classes in assemblies are by definition complete.

You can also find related Interview Question to Can we use two partial classes in different assemblies represent the same Class.  below: 

What is Partial Class?

Partial class:

Instead of defining an entire class, you can split the definition into multiple classes by using the partial keyword. When the application is complied, the C# complier will group all the partial classes together and treat them as a single class. There are a couple of good reasons to use partial classes. Programmers can work on different parts of a class without needing to share the same physical file. Also you can separate your application business logic from the designer-generated code.


Public partial class Employee
public void Method1()

Public partial class Employee
public void Method2()
} (More...)

Which class is the base class of all the exception classes?

System.Exception class is the base class of all the exception classes in .NET. (More...)

Consider the following two classes:

public class Example1
public static int num;

public class Example2
public static void main(String[] args)

Select the correct option regarding the preceding classes.?

1, The Example2 class will execute without any output.
2, The Example2 class will execute with the following output:5

3, The Example2 class will not compile as it does not calls the constructor of the Example 1 class.
4, The Example2 class will not execute as it does not calls the constructor of the Example 1 class.

Answer : 2 (More...)

Name the classes that derive from the abstract System.Windows.Shapes.Shape class in WPF?

1) Rectangle
2) Ellipse
3) Line
4) Polyline
5) Polygon
6) Path (More...)

What is partial Class, Why do we use it?

Partial classes are one which can be defined in different files using partial keyword:

It is maily used for managing the code.Example: a windows form class is split into two files : Form1.cs and Form1.Designer.cs (More...)

What are partial Class?

Partial class are new feature in 2.0 Framework where single class is split among N-number of files,this is usefull when more than one developer wants to work on a same class,through class is split into N-number of files only one constructor will exist among all class files.When CLR complies the partial class after seeing Partial keyword CLR checks for class with same name and combines all partial class and compile it.
Example for partial class are all ASPX pages (More...)

Which of the following statements are correct about the Collection Classes available in Framework Class Library?

A.Elements of a collection cannot be transmitted over a network.
B.Elements stored in a collection can be retrieved but cannot be modified.
C.It is not easy to adopt the existing Collection classes for newtype of objects.
D.Elements stored in a collection can be modified only if allelements are of similar types.
E.They use efficient algorithms to manage the collection, thereby improving the performance of the program.

Answer: Option E (More...)

What is a partial class?

A class which can span multiple source files for the ease of development. (More...)

Can you have two assemblies with the same name in GAC?

Yes you can have two or more assemblies having same name in GAC only when assemblies version no is different.As we know that all assemblies in .NET is having version no. (More...)

What is Satellite Assemblies in .NET?

Assemblies which contains culture information are known as satellite assemblies. Satellite assembly is used to get language specific resources for an application. (More...)

Where are shared assemblies stored in .NET?

Shared Assemblies are stored in Global Assembly Cache also known as GAC. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend