C# Programming Fundamentals Quiz

Test your knowledge of C# programming language features including access modifiers, interfaces, enums, arrays, and OOP concepts.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is not a C# keyword?

  1. if
  2. delegate
  3. private
  4. implements
Question 2 Multiple Choice (Single Answer)

The statement that is used to replace multiple if statements is called?

  1. The switch & case statement
  2. ?: (ternary operator)
  3. The #endif statement
  4. The nestedif statement
Question 3 Multiple Choice (Single Answer)

What is the default access specifier for a Top-level Class, which are not nested into other Classes?

  1. protected
  2. private
  3. internal
  4. public
Question 4 Multiple Choice (Single Answer)

Which statement is true about interface and abstract classes?

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

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

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

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

  1. True
  2. False
  3. Sometimes
  4. None
Question 7 Multiple Choice (Single Answer)

Which of these string definitions will prevent escaping on backslashes in C#?

  1. string s = #"Test string";
  2. string s = ."Test string";
  3. string s = @"Test string";
  4. string s = &"Test string";
Question 8 Multiple Choice (Single Answer)

Can multiple catch blocks be executed for a single try statement? In other words can code inside multiple catch blocks be executed?

  1. No
  2. In certain conditions
  3. Yes
  4. None
Question 9 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() methods
Question 10 Multiple Choice (Single Answer)

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

  1. Spoke
  2. Satellite
  3. Sputnik
  4. Hub
Question 11 Multiple Choice (Multiple Answers)

What are the OOPS Concepts

  1. Abstraction
  2. Encapsulation
  3. Structures
  4. POP
Question 12 Multiple Choice (Multiple Answers)

what is diff between c++ and cobol

  1. POP
  2. OOPS
  3. Strucutres
  4. Pointers
Question 13 True/False

Does C++ support Funcations

  1. True
  2. False
Question 14 True/False

Will C++ supports Structures

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)
  1. class Base{} 2. public class MyCast extends Base{ 3. static boolean b1=false; 4. static int i = -1; 5. static double d = 10.1; 6. public static void main(String argv[]){ 7. MyCast m = new MyCast(); 8. Base b = new Base(); 9. //………..Here 10. }}
  1. b=m;
  2. m=b;
  3. d =i;
  4. b1 =i;