Tuesday, June 23, 2009

C# InterviewQuestions- 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

5 comments:

Vinay Rai said...

Thank you for posting . C# has a good scope these days if you are looking for a software job.

Sir John said...

very interesting site .
Johnny Ray
www,.sirjohn.org/bloglist

madiha junaid said...

c# is getting in the field.i hv ben through it.its gr8
www.junitours.blogspot.com
www.topratedstuffoninternet.blogspot.com
http://every-thing-oninternet.blogspot.com/
http://www.softwares555.blogspot.com
http://gold-markets.blogspot.com

Yadav said...

Very Useful Questions... many thanks for the author

Tristan said...

hey man, you have a mistake in question 66, protected is for derived classes.