C#.Net Interview Question and Answers
26. |
What is Jagged Arrays? |
|
- A jagged array is an array whose elements are arrays.
- The elements of a jagged array can be of different dimensions and sizes.
- A jagged array is sometimes called an array–of–arrays.
|
|
|
27. |
what is an abstract base class? |
|
An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function. |
|
|
28. |
How is method overriding different from method overloading? |
|
When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class. |
|
Tony Martin, said |
July 17, 2018 |
OverLoading: 1. In this case we define multiple methods with the same name by changing their parameters. 2. This can be performed either within a class as well as between parent child classes also. Overriding: 1. In this case we define multiple methods with the same name and same parameters. 2. This can be performed only between parent child class and never be performed with in the same class.
|
Rajakumar, said |
Feb 10, 2014 |
In Method overloading the signature of function is changing by return type or number of parameter of type of parameter but function name is same. In Method overriding the signature of the function is same but functionality of method is change in the derived class.
|
|
29. |
What is the difference between ref & out parameters? |
|
An argument passed to a ref parameter must first be initialized. Compare this to an out parameter, whose argument does not have to be explicitly initialized before being passed to an out parameter. |
|
|
30. |
What is the use of using statement in C#? |
|
The using statement is used to obtain a resource, execute a statement, and then dispose of that resource. |
|
|