C#
Which of the following is a correct way to declare a destructor in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
~MyClass() {}
Answer option 2
destructor MyClass() {}
Answer option 3
void ~MyClass() {}
English
Which of the following is a correct way to handle exceptions in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
try-catch
Answer option 2
try-except
Answer option 3
try-finally
English
What is the output of Console.WriteLine(5 != 2) in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
True
Answer option 2
False
Answer option 3
5
English
What is the output of Console.WriteLine(5 == 2) in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
False
Answer option 2
True
Answer option 3
5
English
Which of the following is a correct way to declare an indexer in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
public int this[int index] { get { return array[index]; } set { array[index] = value; } }
Answer option 2
public int this[int index] = { get { return array[index]; } set { array[index] = value; } }
Answer option 3
public int this[int index] => { get { return array[index]; } set { array[index] = value; } }
English
What is the purpose of the 'event' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To declare an event that can be subscribed to by event handlers
Answer option 2
To declare a constant
Answer option 3
To declare a static field
English
What is the output of Console.WriteLine(5 <= 2) in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
False
Answer option 2
True
Answer option 3
5
English
What is the output of Console.WriteLine(5 >= 2) in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
True
Answer option 2
False
Answer option 3
5
English
Which of the following is a correct way to declare a lambda expression in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
x => x * x
Answer option 2
x -> x * x
Answer option 3
x => { return x * x; }
English
Which of the following is a correct way to declare a tuple in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
var tuple = (1, "Hello");
Answer option 2
var tuple = {1, "Hello"};
Answer option 3
var tuple = [1, "Hello"];
Reference Link
English