Select chapter



Basics (2.papers)
Data Types (2.papers)
enums (2.papers)
OOPS (4.papers)
Arrays (1.papers)
Structs (2.papers)
Properties (2.papers)
Strings (2.papers)
Interfaces (1.papers)
Constructors (2.papers)
Ref-Out-Keywords (1.papers)
Collections (2.papers)
Generics (1.papers)
Hide

Sponsored Links


  

c# constructors interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
What is a constructor ?
  1. A constructor in c# is a special method whose name is same as class name and which is not having any return type.
  2. A Constructor in C# is used for initializing the object.
  3. A Constructor in C# is used for filling data into the object.
  4. All the above definitions are valid.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
4
What is the use of a static Constructor ?
  1. A static constructor is used for initializing instance fields.
  2. A Static constructor is used for initializing static fields.
  3. A static constructor is used for initializing instance as well as static fields.
  4. A static constructor is used for cleaning the object before the Garbage collector deleting objects.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
7
Which of the following statement is not true about constructors?
  1. A constructor can be used for initializing data members of a class.
  2. A constructor can be called explicitly.
  3. A constructor is used for assigning memory to the objects.
  4. A class may contain more than one constructor.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
How to call a base class constructor from derived class Constructor ?
  1. Using this keyword.
  2. Using base keyword
  3. Using super keyword.
  4. Using new keyword.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
Which of the following statement is true about constructors in C#?
  1. Constructors allocate space for the object in memory.
  2. Constructors never return any value.
  3. Constructors cannot be overloaded.
  4. A constructor name must not be same as class name.
Show Answer
Share Facebook gmail Twitter
15
During lifetime of the object how many times a constructor can be called ?
  1. Only once.
  2. As many times as we call it.
  3. Any number of times before the object gets garbage collected.
  4. Any number of times before the object is deleted.
Show Answer
Share Facebook gmail Twitter
16
Which of the following statement is true about constructors in C#.NET?
  1. A constructor can be a static constructor.
  2. A constructor cannot be declared as private.
  3. this reference can not be passed to a constructor.
  4. None of the above
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
How to call an instance constructor from another instance constructor of the same class ?
  1. Using this keyword.
  2. Using base keyword
  3. Using super keyword.
  4. Using me keyword.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :