- You need to write an application in which you create a class that establishes a connection with SQL Server and reads records in a certain table. We need to ensure the following in the class:
- The class should automatically release all the connections after the operation is complete.
- The class should support iteration.
Which of the following interfaces would you implement in the class?
-
- IEnumerator
- IEquatable
- IComparable
- IDisposable
- If you need to write a function that could be called with a varying number of parameters, what would you use?
-
- Interface
- Method overriding
- Method overloading
- Lamda expressions
- You are writing an application in which you need to reverse a string. Which of the following code snippets would you use?
- char[] characters = str.ToCharArray();
for (int start = 0, end = str.Length - 1; start < end; start++, end--)
{
characters...
- char[] characters = str.ToCharArray();