Tag: programming languages

Questions Related to programming languages

Which of the following is not a C# keyword?

  1. if

  2. delegate

  3. private

  4. implements


Correct Option: D

AI Explanation

To answer this question, we need to understand the concept of C# keywords. C# keywords are reserved words that have a specific meaning and cannot be used as identifiers (variable names, method names, etc.) in the code.

Let's go through each option to determine which one is not a C# keyword:

Option A) if - This option is a C# keyword. The "if" keyword is used to perform conditional statements in C#.

Option B) delegate - This option is a C# keyword. The "delegate" keyword is used to declare a reference type that can hold a reference to a method with a specific signature.

Option C) private - This option is a C# keyword. The "private" keyword is an access modifier that specifies that a member (variable, method, etc.) is accessible only within its own class.

Option D) implements - This option is not a C# keyword. The correct answer is D. The "implements" keyword is not a valid keyword in C#. Instead, the "implements" keyword is used in other programming languages like Java to indicate that a class implements an interface.

The correct answer is D. This option is not a C# keyword because the "implements" keyword does not exist in C#.

  1. The switch & case statement

  2. ?: (ternary operator)

  3. The #endif statement

  4. The nestedif statement


Correct Option: A

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


Correct Option: C
  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


Correct Option: A
  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


Correct Option: C

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

  1. True

  2. False

  3. Sometimes

  4. None


Correct Option: B
  1. string s = #"Test string";

  2. string s = ."Test string";

  3. string s = @"Test string";

  4. string s = &"Test string";


Correct Option: C
  1. By calling ReverseSort()

  2. By calling SortReverse()

  3. By calling Descend()

  4. By calling Sort() and then Reverse() methods


Correct Option: D