C#.NET Interview questions


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

Explain about Indexers in C#.NET?

  1. Indexers which are used for treating an object as an array
  2. Indexers are usually known as Smart Arrays
Syntax:  
<Modifier> <return type> this
[Argument list]
{
  get
  {

  }
  set
  {

  }
}
1. Indexers will always be created with this keyword
2. Parameterized properties are called as Indexers
3. Ref and Out keywords are permitted
4. Indexers can not be static but properties can be static
 
Example: 
class Slightbook
{
   private string[] tabs = new string[6];
   public string this [int i]
   {
     get
     {
       return names[i];
     }
     set
     {
       names[i] = value;
     }
   }
}



Next 5 interview question(s)

1
Unsafe keyword in C#.NET?
2
Partial classes and Partial methods in C#.NET?
3
this and base keywords in C#.NET?
4
Static members and Instance members in C#.NET?
5
Difference between Constant Vs Readonly?