C# Test
C# Test
folder
Prelude
7m 56s
done_all
folder
Exception Handling
3h 1m
done_all
folder
Generics
2h 4m
done_all
folder
Collections
5h 53m
done_all
folder
Day 1 Assignments
30m
done_all
folder
CSharp language enhancements
3h 49m
done_all
folder
Delegates
3h 40m
done_all
folder
Day 2 Assignments
1h 17m
done_all
folder
Delegates Enhancements
4h 43m
done_all
folder
Extension Methods
30h 42m
done_all
folder
LINQ - Language Integrated Query
5h 13m
done_all
folder
Day 3 Assignments
1h 40m
done_all
folder
File Handling
1h 38m
done_all
folder
Asynchronous Programming
58m 14s
done_all
folder
Memory Management
1h 33m
done_all
folder
Day 4 Assignments
1h 26m
done_all
folder
Conclusion
50m
done_all
web_asset
Best Practices
5m
done_all
web_asset
View CSharp videos in Digital ...
5m
Q1 of 25
Anonymous methods allow code blocks to be written ___________.
4
6
8
Error : 4th element cannot be added
Q3 of 25
When designing a class, it is recommended to avoid using the Finalize() method.
(i) The garbage collector frees objects that are not referenced and reclaims
their memory
(ii) The garbage collector searches for managed objects that are referenced in
managed code
(iii) The garbage collector tries to finalize objects that are not referenced
ii, i, iii
i, iii, ii
iii, ii, i
ii, iii, i
Q5 of 25
What will be the output of the following code snippet?
class Program
{
private static string result;
Hello world!
Hello user!
Compilation Error - Incorrect usage of 'async' and 'await' keywords
The code executes without displaying any output
Q6 of 25
What will be output for the below code snippet?
}
}
}
Choose the following option:
a. Dispose()
Dispose()
b. Dispose()
Option a
Option b
Option c
Option d
Q7 of 25
Predict the output of the below code snippet:
Console.WriteLine(resultDel(12,10));
}
static int Addition(int num1, int num2)
{
return (num1 + num2);
}
static int Subtraction(int num1, int num2)
{
return (num1 - num2);
}
static int Multiplication(int num1, int num2)
{
return (num1 * num2);
}
}
140
144
120
142
Q8 of 25
What will be the output for the below given code snippet:
class Program
{
public static void Main()
{
SortedList myList = new SortedList();
myList.Add('m', "Harry");
myList.Add('a', "Mark");
myList.Add('b', "Scott");
myList.Add('h', "John");
myList.Add('d', "Larry");
Console.WriteLine(myList.ElementAt(1).Value);
}
}
Mark
Larry
Harry
Scott
Q10 of 25
Identify the invalid statements among the following:
var z = null;
var v = 3;
var x = x++;
var y = new[] {1, 2, 3};
Q11 of 25
Which of the following statements about Generics is FALSE?
(a) Use generic types to maximize type safety, and improve performance
(b) Generics has introduced the concept of type parameters in .NET Framework
Only (a)
Only (b)
Both (a) and (b)
Neither (a) nor (b)
Q12 of 25
What will be the output of the following code snippet?
class Demo
{
static void Main(string[] args)
{
int value1 = 10;
int value2 = 20;
int[] myArray = { 1, 2, 0 };
try
{
double result = value1 / myArray[4];
try
{
double result2 = value2 / myArray[2];
}
catch (Exception e1)
{
Console.Write("one ");
}
finally
{
Console.Write("finally ");
}
}
catch (IndexOutOfRangeException e2)
{
Console.Write("two ");
}
catch (DivideByZeroException e3)
{
Console.Write("three ");
}
}
}
Choose from the following option:
a. two
finally
b. one
finally
c. Compile Time Error - The generic exception cannot appear before the specific
exception
d. finally
two
e. two
Option a
Option b
Option c
Option d
Option e
Q13 of 25
Consider the following code snippet:
Option a
Option b
Option c
Option d
Q16 of 25
Consider the following code snippet:
Func<>
Action<>
Predicate<>
MulticastDelegate
Q19 of 25
Consider the following code snippet:
static void Main(string[] args)
{
#region Demo on File Handling
// LINE 01 - code to open the file "Log.txt" and read the contents from
it
Option a
Option b
Option c
Option d
Q21 of 25
What will be the output of the following code snippet?
Console.WriteLine(at1.GetType() == at2.GetType());
Console.WriteLine(at1 == at2);
Console.WriteLine(at1.Equals(at2));
}
Choose the correct option:
a. True
True
True
b. True
False
False
c. True
False
True
d. False
True
False
Option a
Option b
Option c
Option d
Q22 of 25
Consider the following code snippet:
Option a
Option b
Option c
Option d
Q23 of 25
Which of the following statement(s) about built-in delegates are TRUE?
(a) Func delegate can take parameters and must return any value
(b) Action delegate doesn't take parameters and doesn't return a value
(c) Predicate delegate can take parameters but returns only int value