C# Programming Fundamentals Quiz
Test your knowledge of C# programming language features including access modifiers, interfaces, enums, arrays, and OOP concepts.
Questions
Which of the following is not a C# keyword?
- if
- delegate
- private
- implements
The statement that is used to replace multiple if statements is called?
- The switch & case statement
- ?: (ternary operator)
- The #endif statement
- The nestedif statement
What is the default access specifier for a Top-level Class, which are not nested into other Classes?
- protected
- private
- internal
- public
Which statement is true about interface and abstract classes?
- A class may inherit several interfaces, A class may inherit only one abstract class
- An abstract class may only contain incomplete methods (abstract methods)
- An interface may contain complete or incomplete methods
- 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
If a method is marked as protected internal who can access it?
- Access is limited to the current assembly
- Access is limited to the containing class or types derived from the containing class.
- Access is limited to the current assembly or types derived from the containing class.
- Access is limited to the containing type
The default type of enum is integer and has a default value 1.
- True
- False
- Sometimes
- None
Which of these string definitions will prevent escaping on backslashes in C#?
- string s = #"Test string";
- string s = ."Test string";
- string s = @"Test string";
- string s = &"Test string";
Can multiple catch blocks be executed for a single try statement? In other words can code inside multiple catch blocks be executed?
- No
- In certain conditions
- Yes
- None
How can you sort the elements of the array in descending order?
- By calling ReverseSort()
- By calling SortReverse()
- By calling Descend()
- By calling Sort() and then Reverse() methods
What is the name given to the type of assembly that contains localized resources?
- Spoke
- Satellite
- Sputnik
- Hub
What are the OOPS Concepts
- Abstraction
- Encapsulation
- Structures
- POP
what is diff between c++ and cobol
- POP
- OOPS
- Strucutres
- Pointers
Does C++ support Funcations
- True
- False
Will C++ supports Structures
- True
- False
- 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. }}
- b=m;
- m=b;
- d =i;
- b1 =i;