Vidyalelo
C# Programming · all questions

Miscellaneous in C Sharp
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

170

Questions

2/9

Page

Pick an option on a question to see the right answer and solution.

What is the purpose of the "base" keyword in C#?

Select an option to see the answer and solution.

Which of the following statements about properties in C# is true?

Select an option to see the answer and solution.

What is the purpose of the "static" keyword in C#?

Select an option to see the answer and solution.

Which of the following statements about constructors in C# is true?

Select an option to see the answer and solution.

What does the "abstract" keyword indicate in C#?

Select an option to see the answer and solution.

What is the purpose of the "delegate" keyword in C#?

Select an option to see the answer and solution.

Which of the following is NOT a valid C# data type?

Select an option to see the answer and solution.

What is the default value of a boolean variable in C# if it is not explicitly initialized?

Select an option to see the answer and solution.

What does the "out" keyword allow in C# method parameters?

Select an option to see the answer and solution.

What is the purpose of the "as" keyword in C#?

Select an option to see the answer and solution.

What does the "var" keyword do in C#?

Select an option to see the answer and solution.

Which of the following is NOT a valid type conversion in C#?

Select an option to see the answer and solution.

What does the "out" keyword do in C# method parameters?

Select an option to see the answer and solution.

What does the "async" and "await" keywords do in C#?

Select an option to see the answer and solution.

What is the purpose of the "is" keyword in C#?

Select an option to see the answer and solution.

What does the "as" keyword do in C#?

Select an option to see the answer and solution.

What is the purpose of the "typeof" operator in C#?

Select an option to see the answer and solution.

What does the "break" keyword do in a switch statement in C#?

Select an option to see the answer and solution.

What will be the output of the following C# code snippet?
public class A
{
    public int x;
    public int y;
    public void display() 
    {
        Console.WriteLine(x + " " + y);
    }
}
class Program
{
    static void Main(string[] args)
    {
        A obj1 = new A();
        A obj2 = new A();
        obj1.x = 1;
        obj1.y = 2;
        obj2 = obj1;
        obj1.display();
        obj2.display();
    }
}

Select an option to see the answer and solution.

Which method is called when a thread is blocked from running temporarily?

Select an option to see the answer and solution.