16. Which of the following statements about const and readonly is correct?
Anonymous Quiz
0%
A. const is evaluated at runtime, readonly at compile time
33%
B. const can be assigned only at declaration, readonly can be assigned in constructor
67%
C. Both are the same
0%
D. readonly variables cannot be initialized
❤1
17. Which keyword is used to define an extension method?
Anonymous Quiz
0%
A. this
50%
B. extends
50%
C. static
0%
D. partial
18. What is the output of this code? object o = null;Console.WriteLine(o ?? "Default");
Anonymous Quiz
40%
A. null
20%
B. Default
40%
C. Runtime error
0%
D. Compilation error
20. Which collection in C# works on FIFO (First In First Out) principle?
Anonymous Quiz
0%
A. Stack<T>
40%
B. Queue<T>
40%
C. List<T>
20%
D. HashSet<T>
21. Which method is always called before an object is destroyed by GC (if implemented)?
Anonymous Quiz
25%
A. Dispose()
25%
B. Close()
50%
C. Finalize()
0%
D. Release()
22. Which C# keyword prevents further overriding of a method?
Anonymous Quiz
20%
A. abstract
40%
B. sealed
40%
C. override
0%
D. readonly
23. What will be the output?int[] arr = new int[5];Console.WriteLine(arr[0]);
Anonymous Quiz
20%
A. 0
20%
B. null
60%
C. Garbage value
0%
D. Compilation error
24. Which of the following statements about interface is false?
---
---
Anonymous Quiz
0%
A. Interface cannot contain fields
20%
B. Interface can have default implementations (C# 8.0+)
0%
C. A class can implement multiple interfaces
80%
D. Interface can inherit from multiple classes
25. Which keyword is used to safely handle exceptions?
Anonymous Quiz
40%
A. finalize
0%
B. throw
60%
C. try-catch
0%
D. dispose
26. Which of the following types supports nullable values in C#?
Anonymous Quiz
0%
A. int?
17%
B. string?
50%
C. Nullable<int>
33%
D. Both A and C
27. What will be the output?
string s = "abc"; s.ToUpper(); Console.WriteLine(s);
string s = "abc"; s.ToUpper(); Console.WriteLine(s);
Anonymous Quiz
86%
A. ABC
0%
B. abc
14%
C. Compilation error
0%
D. NullReferenceException
28. Which of these LINQ methods returns the first element of a sequence?
Anonymous Quiz
0%
A. Take()
100%
B. First()
0%
C. Select()
0%
D. Where()
29. Which statement is true about async and await?
Anonymous Quiz
25%
A. async makes method run on new thread
25%
B. await blocks the thread until result is returned
50%
C. async marks method for asynchronous execution, await pauses until result is ready
0%
D. Both are same
30. What is boxing in C#?
Anonymous Quiz
14%
A. Converting int to double
71%
B. Converting value type to reference type
0%
C. Converting string to integer
14%
D. Converting object to do struct
Forwarded from Rohit Chopade
Q1. Which keyword is used to create an object in C#?
Anonymous Quiz
67%
New
33%
Class
0%
Object
0%
This
Forwarded from Rohit Chopade
Q2. What is a class in C#?
Anonymous Quiz
0%
A variable
40%
A data type
60%
blueprint for creating objects
0%
An object itself
Forwarded from Rohit Chopade
In C#, objects are created from a:
Anonymous Quiz
60%
Class
20%
Method properties
20%
Merhod
0%
Variables
Forwarded from Rohit Chopade
Q4. Which of the following is true about objects?
Anonymous Quiz
60%
a) Objects are instances of a class
20%
b) Objects define the structure of a class
0%
c) Objects are always static
20%
d) Objects cannot store data
Forwarded from Rohit Chopade
Consider the code:
class Car { } Car myCar = new Car(); Here what is my car?
class Car { } Car myCar = new Car(); Here what is my car?
Anonymous Quiz
18%
Class
27%
Method
45%
Variable
9%
Data type