ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net Framework
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
what are partial classes?
 Question Submitted By :: Swapna
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what are partial classes?
Answer
# 1
Partial classes is a new feature of OOPs in .NET2.0 

Partial classes means split the class into multiple files.


For example 

             u r working with windows applications actually
designer.cs is using a class like webform1, u can use this
class in other cs file also.
 
Is This Answer Correct ?    24 Yes 4 No
Chaitanya.k
 
  Re: what are partial classes?
Answer
# 2
using a partial class, we can split a class into multiple 
files.
compiler will treat them as different classes.
but when compiled all the files will be treated as a single 
class.
it is more efficeint
 
Is This Answer Correct ?    19 Yes 1 No
Anna
 
 
 
  Re: what are partial classes?
Answer
# 3
One of the greatest benefits of partial classes is that it 
allows a clean separation of business logic and the user 
interface (in particular the code that is generated by the 
visual designer). Using partial classes, the UI code can be 
hidden from the developer, who usually has no need to 
access it anyway. Partial classes will also make debugging 
easier, as the code is partitioned into separate files.
 
Is This Answer Correct ?    9 Yes 3 No
Rashmi Tiwari
 
  Re: what are partial classes?
Answer
# 4
Partal classes can help in segregating code with respect 
type like tool visual Studio generated,default imported 
namespaces , events registration , variable declaration 
code etc. It is best to split lengthy code into smaller 
units but dealing them with same class Object
 
Is This Answer Correct ?    4 Yes 2 No
Zahid Nawaz
 
  Re: what are partial classes?
Answer
# 5
through partial keyword we can split the defination of the 
class in different source files and these definations are 
combined when application is compiled.

it may be helpful in large projects,so many people can work 
on same class
 
Is This Answer Correct ?    8 Yes 0 No
Kamlesh Sharma
 
  Re: what are partial classes?
Answer
# 6
Can you u explain me the code for the partaial class?
 
Is This Answer Correct ?    4 Yes 3 No
Sharif
 
  Re: what are partial classes?
Answer
# 7
File 1.
partial class Employee 
{
 string employeename;
 public void getEmployeeName(string empname)
 {
   employeename = empname;
 }
 
 public static void Main()
 {

  Employee objEmployee = new Employee();
  objEmployee.getEmployeeName("Krish");
  objEmployee.showEmployeeName();
  Console.ReadLine();
 }

}
File 2

partial class Employee
 {
  public void showEmployeeName()
  {
    Console.WriteLine("Name --->" + employeename);
  }

 }

Even though the method showEmployeeName is not a available 
in file 1 since  its partial class the complier would 
combine the fragments of the file that corresponds to same 
class.
 
Is This Answer Correct ?    13 Yes 1 No
Sridhar.venkataramanan
 
  Re: what are partial classes?
Answer
# 8
The purpose of partial classes is to allow a class's
definition to span across multiple files. It is especially
useful for:

Allowing multiple developers to work on a single class at
the same time without the need for later merging files in
source control.

Allowing a separation between the class interface and the
implementation-related definitions

Easing the writing of code generators, such as visual designers.
 
Is This Answer Correct ?    3 Yes 1 No
Sunny Setia
 
  Re: what are partial classes?
Answer
# 9
Partial class is a new functionality that is included in 
Visual Studio .Net 2005 and is supported in ASP.Net 2.0. 
This new functionality helps you to split a single class 
into multiple partial classes. These partial classes can be 
in different individual files.
 
Is This Answer Correct ?    1 Yes 3 No
Rony Sunny
 
  Re: what are partial classes?
Answer
# 10
Partial Class Means That At  Compilation Time Your Code 
Behind File And Web Form Are Now Merged Into One Class File.
 
Is This Answer Correct ?    2 Yes 6 No
Shoaib Akhtar
 
  Re: what are partial classes?
Answer
# 11
Partial class is th one feature in V2.0 where you can split 
the functionalty of the single file in multiple files.

This is helpful on working simultaneously on same file, 
clearly separates Business Logic and UI, separets logic 
from single file to multiple files.

File1
Imports system
Interface IPartialInterface

sub abc( byval str as string)
sub abc()
End interface

Partial Class DemoPartialClass
dim strName a string
strName = "Anil"
Response.Write(strName)
End Class

File2

Imports system
Implements IPartialInterface

Partial Class DemoPartialClass
Public sub abc(ByVal strName as string)
Dim strValue as string
strValue = strName
End Sub
End Class

File 3

Imports system
Implements IPartialInterface

Partial Class DemoPartialClass
public sub abc()
response.write(strName)
End Sub
End Class
 
Is This Answer Correct ?    2 Yes 0 No
Anil
 

 
 
 
Other Dot Net Framework Interview Questions
 
  Question Asked @ Answers
 
How will you load dynamic assembly? How will create assemblies at run time? MGL3
Can source code be reverse-engineered from IL?  2
what are partial classes? HP11
What are the ways to deploy an assembly?  1
About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use ? MMTS2
What are Satellite Assemblies? How you will create this?  3
How .net assemblies are registred as private and shared assembly ? MMTS1
Why are there five tracing levels in System.Diagnostics.TraceSwitcher?  1
What is MSIL, IL, CTS?  3
Which is the best institute in chennai to learn DotNet?  6
Can we look at the IL for an assembly?  2
I have interview in accenture.I cleared 1st round in techniqual.I have interview with project lead.pls help me. Accenture2
How do you register the dotnet component or assembly ? Accenture1
What is side by side Execution ? MMTS3
what is difference b/w .net 1.1 and .net 2.0. I need Answer in c# , asp.net and ado.net Level.Like c#1.1 and c#.1.1 , ado.net1.1 and ado.net2.0 and asp.net1.1 and asp.net2.0  4
What is .NET Framework?  3
Requirement is: try { \\SQL Query } catch(Exception i) { print a } catch(SQLQueryException e) { \\SQL Query } Qu)I Got Exception in "try" block. Which "catch" statement (i.e. 1st catch or 2nd catch ) catches the exception and Why??? 3i-Infotech3
can we call the garbage collector to run explicicitly? Kanbay5
About .NET Framework ? MMTS4
Difference between <connectionstring> and <appsettings>  3
 
For more Dot Net Framework Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com