Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q611: Which of the following is an example of a C# reference type?
- A: string
- B: int
- C: float
- D: char
View Answer
A
Q612: What is the output of the following code: Console.WriteLine("Hello World!");
- A: Hello
- B: Hello World
- C: World
- D: Error
View Answer
B
Q613: What is the purpose of the get method in C#?
- A: To assign values
- B: To retrieve values
- C: To delete values
- D: To modify values
View Answer
B
Q614: Which of the following is NOT a C# value type?
- A: int
- B: string
- C: char
- D: bool
View Answer
B
Q615: What does C# use for a safer enumeration?
- A: Enum
- B: Struct
- C: Delegate
- D: Array
View Answer
A
Q616: Which data type in C# is used to store Boolean values?
- A: int
- B: bool
- C: char
- D: string
View Answer
B
Q617: What happens if you try to use an uninitialized variable in C#?
- A: The compiler throws an error
- B: It gets a default value
- C: It is initialized to zero
- D: It gets an undefined value
View Answer
A
Q618: Which statement about C# and Java is FALSE?
- A: Both compile to intermediate language
- B: Both have garbage collection
- C: C# supports unsafe pointers by default
- D: Both support only OOP
View Answer
C
Q619: C# does not support _______.
- A: operator overloading
- B: threading
- C: exception handling
- D: structured programming
View Answer
D
Q620: In C#, which keyword is used to define a property?
- A: property
- B: get/set
- C: public
- D: class
View Answer
B