C#.NET Interview questions


Total available count: 70
Subject - Microsoft Technologies
Subsubject - C#.NET

Partial classes and Partial methods in C#.NET?

Partial class:

  1. Splitting a class file into multiple class files by using partial keyword
  2. C#.NET generally creates a class with partial keyword that means that class can be split and used
Below are the situations where partial class is usable.
1. When working on large projects, spreading a class over multiple files and multiple programs are enable to work on
 
Example: 
public partial class Slightbook
{
   public void InterviewQuestions()
   {

   }
}
public partial class Slightbook
{
  public void CodeSnippets()
  {

  }
}

 

Partial method:

1. Partial method declarations must begin with partial and return with void
2. Partial method can have ref but not out parameters
3. partial methods are implicitly private but can not virtual
 
Example: 
public partial class Slightbook
{
   public partial void InterviewQuestions()
   {

   }
}



Next 5 interview question(s)

1
this and base keywords in C#.NET?
2
Static members and Instance members in C#.NET?
3
Difference between Constant Vs Readonly?
4
What is a Load factory in C#.NET?
5
Explain about System.Collections?