C# and ASP.NET Programming Quiz

Test your knowledge of C# programming language concepts and ASP.NET web development fundamentals.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

If method is marked as protected internal who can access it?

  1. Access is limited to current assembly
  2. Access is limited to the containing class or types derived from containing class
  3. Access is limited to the containing type
  4. Access is limited to current assembly or types derived from the containing class.
Question 2 Multiple Choice (Single Answer)

How can you sort the elements of the array in descending order

  1. By calling ReverseSort()
  2. By calling SortReverse()
  3. By calling Descend()
  4. By calling Sort() and then Reverse() method
Question 3 Multiple Choice (Single Answer)

Which of following statement correctly declares a 2 dimensional array in c#.

  1. int[,] myarray
  2. int[][] myarray
  3. int[2] myarray
  4. none of above
Question 4 Multiple Choice (Single Answer)

Give some examples of generic classes.

  1. List ,HashSet
  2. Queue
  3. Stack
  4. LinkedList
  5. All of Above
Question 5 Multiple Choice (Single Answer)

What is default access modifier for top level class , which are not nested in other classes

  1. Public
  2. Private
  3. Protected
  4. Internal
Question 6 Multiple Choice (Single Answer)

What is difference between interface and abstract class

  1. An abstract class may only contain on complete method
  2. An interface may contain complete or incomplete method
  3. A class may inherit several interfaces , A class may inherit only one abstract class.
  4. A class implementation an abstract class has to implement all methods of abstract class , but same is not required in case of an interface.
  5. All
Question 7 Multiple Choice (Single Answer)

Does this code compile? Public interface MyInterface { string MyProp { get; } }

  1. Yes
  2. No, because the interface name does not start with 'I'
  3. No, because MyProp is not declared as public
  4. No, because interfaces can't contain property declaration
Question 8 True/False

The default type of enum is integer and has default value 1

  1. True
  2. False
Question 9 Multiple Choice (Single Answer)

What is the last stage of the webforms cycle?

  1. Event Handling
  2. Page_Load
  3. Validate
  4. Page_Unload
Question 10 Multiple Choice (Single Answer)

What is the size for double data type in c#

  1. 1 Byte
  2. 2 Byte
  3. 4 Byte
  4. 8 Byte
  5. 16 Byte
Question 11 Multiple Choice (Single Answer)

If method is marked as protected internal who can access it?

  1. Access is limited to current assembly
  2. Access is limited to the containing class or types derived from containing class
  3. Access is limited to the containing type
  4. Access is limited to current assembly or types derived from the containing class.
Question 12 Multiple Choice (Single Answer)

How can you sort the elements of the array in descending order

  1. By calling ReverseSort()
  2. By calling SortReverse()
  3. By calling Descend()
  4. By calling Sort() and then Reverse() method
Question 13 Multiple Choice (Single Answer)

Which of following statement correctly declares a 2 dimensional array in c#.

  1. int[,] myarray
  2. int[][] myarray
  3. int[2] myarray
  4. none of above
Question 14 Multiple Choice (Single Answer)

Give some examples of generic classes.

  1. List ,HashSet
  2. Queue
  3. Stack
  4. LinkedList
  5. All of Above
Question 15 Multiple Choice (Single Answer)

What is default access modifier for top level class , which are not nested in other classes

  1. Public
  2. Private
  3. Protected
  4. Internal
Question 16 Multiple Choice (Single Answer)

What is difference between interface and abstract class

  1. An abstract class may only contain on complete method
  2. An interface may contain complete or incomplete method
  3. A class may inherit several interfaces , A class may inherit only one abstract class.
  4. A class implementation an abstract class has to implement all methods of abstract class , but same is not required in case of an interface.
  5. All
Question 17 Multiple Choice (Single Answer)

Does this code compile? Public interface MyInterface { string MyProp { get; } }

  1. Yes
  2. No, because the interface name does not start with 'I'
  3. No, because MyProp is not declared as public
  4. No, because interfaces can't contain property declaration
Question 18 Multiple Choice (Single Answer)

How does asp.net store session IDs by default?

  1. In Cache
  2. Cookies
  3. In Global variable
  4. URL Strings
Question 19 Multiple Choice (Single Answer)

Whst is the name given to the type of assembly that contains localized resources

  1. Spoke
  2. Hub
  3. Sputnik
  4. Satellite
Question 20 Multiple Choice (Single Answer)

Web security is very important by default on any website. By default, a .net website is configuesd with which type of authentication?

  1. Anonymous
  2. Basic
  3. Integreted windows authentication
  4. 1 & 3