Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 31
Q601:
C# supports which type of inheritance?
A. Single Inheritance
B. Multiple Inheritance
C. Hybrid Inheritance
D. No Inheritance
Correct Answer: A
Chapter: 31
Q602:
In C#, arrays have built-in ________.
A. indexing
B. bounds checking
C. value assignment
D. loop control
Correct Answer: B
Chapter: 31
Q603:
The ".NET platform" is centered around which feature?
A. Garbage Collection
B. Common Language Runtime
C. Reflection
D. Structs
Correct Answer: B
Chapter: 31
Q604:
Which of the following is a type of array supported by C#?
A. Single-dimensional arrays
B. Multi-dimensional rectangular arrays
C. Multi-dimensional jagged arrays
D. All of the above
Correct Answer: D
Chapter: 31
Q605:
What keyword in C# is used to allocate memory for an object?
A. malloc
B. new
C. alloc
D. create
Correct Answer: B
Chapter: 31
Q606:
In C#, 'null' is a _______.
A. Data type
B. Keyword
C. Method
D. Class
Correct Answer: B
Chapter: 31
Q607:
C# supports _______ to implement event handling.
A. delegates
B. methods
C. arrays
D. functions
Correct Answer: A
Chapter: 31
Q608:
Which is a built-in C# data type?
A. decimal
B. integer
C. float32
D. unsigned
Correct Answer: A
Chapter: 31
Q609:
In C#, structs are passed by _______.
A. reference
B. value
C. object
D. pointer
Correct Answer: B
Chapter: 31
Q610:
What does the term 'unsafe' mean in C#?
A. Limited pointer use
B. No memory access
C. Read-only variables
D. No inheritance
Correct Answer: A
Chapter: 31
Q611:
Which of the following is an example of a C# reference type?
A. string
B. int
C. float
D. char
Correct Answer: A
Chapter: 31
Q612:
What is the output of the following code: Console.WriteLine("Hello World!");
A. Hello
B. Hello World
C. World
D. Error
Correct Answer: B
Chapter: 31
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
Correct Answer: B
Chapter: 31
Q614:
Which of the following is NOT a C# value type?
A. int
B. string
C. char
D. bool
Correct Answer: B
Chapter: 31
Q615:
What does C# use for a safer enumeration?
A. Enum
B. Struct
C. Delegate
D. Array
Correct Answer: A
Chapter: 31
Q616:
Which data type in C# is used to store Boolean values?
A. int
B. bool
C. char
D. string
Correct Answer: B
Chapter: 31
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
Correct Answer: A
Chapter: 31
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
Correct Answer: C
Chapter: 31
Q619:
C# does not support _______.
A. operator overloading
B. threading
C. exception handling
D. structured programming
Correct Answer: D
Chapter: 31
Q620:
In C#, which keyword is used to define a property?
A. property
B. get/set
C. public
D. class
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now