C#
Which of the following is a correct way to declare a dynamic type in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
dynamic dynVar = 1;
Answer option 2
var dynamic dynVar = 1;
Answer option 3
dynamic var dynVar = 1;
English
What is the purpose of the 'unsafe' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To denote a block of code that uses pointers.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English
What is the purpose of the 'fixed' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To pin a variable in memory so that its address remains constant.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English
What is the purpose of the 'extern' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To declare a method that is implemented externally.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English
Which of the following is a correct way to declare an anonymous type in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
var anon = new { Name = "John", Age = 30 };
Answer option 2
var anon = new { "John", 30 };
Answer option 3
var anon = new { Name: "John", Age: 30 };
English
What is the purpose of the 'volatile' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To indicate that a field might be modified by multiple threads.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English
Which of the following is a correct way to declare a partial class in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
public partial class MyClass {}
Answer option 2
partial public class MyClass {}
Answer option 3
public class partial MyClass {}
English
What is the purpose of the 'unchecked' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To suppress overflow-checking for integral-type arithmetic operations.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English
Which of the following is a correct way to declare a generic class in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
public class MyClass<T> {}
Answer option 2
public class MyClass<> {}
Answer option 3
public class MyClass<T,> {}
English
What is the purpose of the 'checked' keyword in C#?
Anonymous (not verified)
Subject
Correct answer position
1
Answer option 1
To explicitly enable overflow checking for integral-type arithmetic operations.
Answer option 2
To declare a method as static.
Answer option 3
To declare a method as virtual.
English