NEW
Font size
WorksheetsC# Skill Review
Total questions: 32
Worksheet time: 16mins
C# class can inherit multiple ________
Interfaces
Classes
Abstract classes
Static classes
Which of the followings are value types in C#?
Int32
Double
Decimal
All of these options
Which of the following is a reference type in C#?
String
Long
Boolean
None
What is Nullable type?
It allows assignment of null to reference type.
It allows assignment of null to value type.
It allows assignment of null to static class.
None
Struct is a _____.
Reference type
Class type
Value type
String type
10 > 9 ? "10 is greater than 9” : "9 is greater than 10” is an example of _______
Inverse operator
Conditional operator
Greater than operator
Ternary operator
Which of the following datatype can be used with enum?
Int
String
Boolean
All of these options
What is indexer?
It allows enumerator with class
It creates index for instances of a class.
It allows an instance of a class to be indexed like an array
None
String data type is ______.
Mutable
Immutable
Static
Value type
An array in C# starts with _____ index.
1
0
-1
null
How to declare an array in C# correctly?
int[] intArray = new int[];
int intArray[] = new int[5];
int[] intArray = new int[5];
int[5] intArray = new int[];
Which of the following is true for ReadOnly variables?
Value will be assigned at runtime.
Value will be assigned at compile time.
Value will be assigned when it accessed first time
None
Which of the following statement is false?
try block must be followed by catch or finally block or both.
finally block cannot include return statement.
try block can include another try block.
none of these options.
Which of the following statement is true?
A finally block may not execute every time
A return or break statement cannot exit a finally block.
A finally block can come before catch block.
Multiple finally block is possible.
Func and Action are the types of ______.
Utility function
Delegate
Event
Generic class
Return type of Predicate <T>() is always a ______.
Integer
String
Void
Boolean
A partial class allows ________
Implementation of single class in multiple .cs files.
Declaration of multiple classes in a single .cs file.
Implementation of multiple interfaces to single class.
Multiple class inheritance.
LINQ stands for ________.
Local Integration Query
Language Integrated Query
Language Included Query
Lazy Integrated Query
Data type of a variable declared using var will be assigned at _______.
Compile time
Runtime
CLR time
Application Initialization time.
Which of the following is true for dynamic type in C#?
It allows multiple time declaration of a variable.
It allows compile time type checking
It escapes compile time type checking
None
The keyword to provides a non-blocking way to start a task, then continue execution when that task completes is
await
sleep
async
volatile
run
Class which represents a single operation that does not return a value and that usually executes asynchronously is____
Async
Thread
Task
Mutex
Job
If you want to wait all certain tasks to be done, before proceeding, you use await keyword combined with _____ function.
Task.WhenAny(...);
Task.WhenAll(...);
Task.WhenAwaitAll(...);
Task.FinishedAll(...);
Task.AllDone(...);
Task.WhenAny() will return ___
The longest task to be completed
Random task
All of the completed tasks given
The completed task in a task list/array
An asynchronous method to force the method to complete asynchronously.
Run()
Yield()
WhenAll()
RunSynchronously()
The class that sends (or raises) the event is called ___
publisher
receiver
sender
transmitter
broadcaster
To attach an event handler to the event we could use ____
+=
-=
.addEvent();
delegate()
A type which represents references to methods with a particular parameter list and return type.
event
lambda expression
delegate
function
to read a text file to string you could use ___
StreamReader
FileStream
FileMode
BufferedStream
The default LogLevel in Logging functionality is
Critical
Error
Information
Debug
Below are the LogLevel, except _____
Information
Trace
None
Critical
Crashing
To store items as key and value pairs we could use _____ collection.
Stack
Queue
List
Dictionary
