InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Why To Use "using" Statement In C#? |
|
Answer» The using BLOCK is used to OBTAIN a RESOURCE and USE it and then automatically dispose off when the execution of block completed. The using block is used to obtain a resource and use it and then automatically dispose off when the execution of block completed. |
|
| 2. |
What Is The Difference Between “dispose” And “finalize” Variables In C#? |
|
Answer» Dispose() Method
Finalize() Method
Dispose() Method Finalize() Method |
|
| 3. |
Difference Between Const, Readonly And Static Readonly In C# ? |
Answer»
|
|
| 4. |
What's The Difference Between The 'ref' And 'out' Keywords? |
|
Answer» An ARGUMENT passed as "REF" must be initialized before passing to the METHOD whereas "out" parameter needs not to be initialized before passing to a method, and it will be initialized inside the method. An argument passed as "ref" must be initialized before passing to the method whereas "out" parameter needs not to be initialized before passing to a method, and it will be initialized inside the method. |
|
| 5. |
Is It Possible For A Class To Inherit The Constructor Of Its Base Class? |
|
Answer» No. A CLASS cannot INHERIT the CONSTRUCTOR of its BASE class. No. A class cannot inherit the constructor of its base class. |
|
| 6. |
Can 'this' Be Used Within A Static Method? |
|
Answer» No. No. |
|
| 7. |
What Is 'this' Pointer? |
|
Answer» 'this' POINTER REFERS to the CURRENT OBJECT of a CLASS. 'this' pointer refers to the current object of a class. |
|
| 8. |
Can You Prevent A Class From Overriding? |
|
Answer» YES. You can prevent a class from overriding in C# by USING the sealed keyword; and in VB by using NotInheritable keyword. Yes. You can prevent a class from overriding in C# by using the sealed keyword; and in VB by using NotInheritable keyword. |
|
| 9. |
Is It Possible To Execute Two Catch Blocks? |
|
Answer» No. Whenever, an exception occurs in your PROGRAM, the correct catch block is EXECUTED and the CONTROL goes to the finally block. No. Whenever, an exception occurs in your program, the correct catch block is executed and the control goes to the finally block. |
|
| 10. |
Can You Inherit Private Members Of A Class? |
|
Answer» No, we cannot INHERIT PRIVATE MEMBERS of a CLASS because private members are accessible only to that class and not OUTSIDE that class. No, we cannot inherit private members of a class because private members are accessible only to that class and not outside that class. |
|