Correct Answer: False
Explanation:
Note: This Question is unanswered, help us to find answer for this one
C# Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More C# MCQ Questions
Consider the following catch block: try { // code that throws an Exception } catch( Exception e) { // Question: What is the difference between throw e; // and throw; }
What will be the output of the following code : public static void Main() { int value = 1; Task t1 = Task.Run(() => { if (value == 1) { Thread.Sleep(1000); value = 2; } }); Task t2 = Task.Run(() => { value = 3; }); Task.WaitAll(t1, t2); Console.WriteLine(value); Console.ReadLine(); }
What will be the output of the following code ? public delegate TextWriter tw(); public static StringWriter stw() { return new StringWriter(); } public static StreamWriter sw() { return null; } public static void Main() { tw t = sw; t += stw; var tt = t(); Console.WriteLine(tt == null ? "Null" : "Not null"); }
What is the result of the following code ? public static void Main() { Derived2 d = new Derived2(); Console.WriteLine(d.GetTempValue()); } public class BaseClass { public virtual int GetTempValue() { return 1; } } public class Derived1 : BaseClass { public sealed override int GetTempValue() { return 2 * base.GetTempValue(); } } public class Derived2 : Derived1 { public sealed override int GetTempValue() { return 2 * base.GetTempValue(); } }
A delegate inherits from:
How can a single instance application be created in C#?
The number of objects of a given class that exist can be tracked by a introducing a class member variable. Which one of the following solutions allows for this behavior?
Which of the following is the correct way to find a string within a string while being case insensitive?
Consider the following code: public class ClassPoint { public int X; public int Y; public ClassPoint(int a, int b) { X = a; Y = b; } } public struct StructPoint { public int X; public int Y; public StructPoint(int a, int b) { X = a; Y = b; } } public class Test { static void Main(string[] args) { ClassPoint a = new ClassPoint(10, 10); ClassPoint b = a; a.X = 100; StructPoint c = new StructPoint(10, 10); StructPoint d = c; c.X = 100; Console.WriteLine(b.X.ToString() + ',' + d.X); } } What will be the output printed on the screen?
Which of the following is the correct way to sort a C# dictionary by value?