C# QUIZ 3 4 Created on May 13, 2020 By Sirjana GhimireAcharya C# Quiz 3 1 / 10 Which of the following statements are correct for the given code snippet:shape obj;obj = new shape(); creates an object of class shape. To create an object of type shape on the heap or stack depending on its size. create a reference obj of the class shape and an object of type shape on the heap. create an object of type shape on the stack. 2 / 10 2. Which .NET collection class allows elements to be accessed using a unique key? ListDictionary Hashtable StringCollection ArrayList 3 / 10 3. Which of the following C# keywords has nothing to do with multithreading? async await sealed lock 4 / 10 4. Find an invalid expression among the following C# Generics examples. class A where T : class, new() class A where T : struct, IComparable class A where T : class, struct class A where T : Stream where U : IDisposable 5 / 10 5. new keyword in C# is used to creat new object from the type. Which of the followings is not allowed to use new keyword? Class: var a = new Class1(); Interface : var a = new IComparable(); Struct : var a = new Struct1(); C# object : var a = new object(); 6 / 10 6. Can you specify accessibility modifier for methods inside an interface? Yes No 7 / 10 7. Arrange the following datatype in order of increasing magnitude sbyte, short, long, int. short < int < sbyte < long short < sbyte < int < long sbyte < short < int < long long < short < int < sbyte 8 / 10 8. How do you create a variable with the floating number 2.8? double x = 2.8D; int x = 2.8D; byte x = 2.8 int x = 2.8; 9 / 10 9. Which method can be used to find the length of a string? getLength() length() len() Length 10 / 10 10. Which of the following access specifier in C# allows a child class to access the member variables and member functions of its base class? Public Private Protected Internal Your score is The average score is 65% LinkedIn Facebook Twitter 0% Restart quiz