C# Multiple Choice Questions And Answers
Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
- Default point
- Invoking point
- Calling point
- Throw point
- Every derived class does not define its own version of the virtual method.
- By default, the access mode for all methods in C# is virtual.
- If a derived class, does not define its own version of the virtual method, then the one present in the base class gets used.
- All of the above.
using System;
class sample
{
public sample()
{
Console.WriteLine("constructor 1 called");
}
public sample(int x)
{
int p = 2;
int u;
u = p + x;
Console.WriteLine("constructor 2 called");
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample(4);
sample t = new sample();
Console.ReadLine();
}
}
- constructor 1 called constructor 2 called
- constructor 2 called constructor 1 called
- constructor 2 called constructor 2 called
- error