25 August, 2009

C# Interview Questions - Part 7

Interview Questions
----------------------------
61. Can private virtual methods be overridden ?
a ) No. we can not access private methods in inherited classes.

62. Can we inherit multiple interfaces?
a ) yes. In c# multiple inheritance is achieved through interfaces.

63.How can a method be overloaded?
a ) a method can be overloaded by creating a method with the same name but with different parameter order, data types and number

64. Will finally block get executed if the exception had not occurred?
a ) Yes. Finally block always gets executed regardless of an error.

65. Can multiple catch blocks be executed ?
a ) No. once the appropriate catch code is fired control transfer to the finally block then continues with the rest of the code.

66. What is the accessibility level of a protected variable?
a ) It is available to the classes in the same name space.

67. Can you override private virtual methods
a ) No.

68. Can we inherit multiple interfaces?
a) Yes. We can’t inherit multiple classes but we can inherit multiple interfaces.

69. Can we use virtual keyword to a destructor?
a ) No

70. What is the access level of a internal variable?
a ) current assembly

No comments: