Tuesday, May 22, 2007

Some C# interview Questions

Q: Does C# support multiple-inheritance?

Ans: No.

Q: Who is a protected class-level variable available to?

Ans: It is available to any sub-class (a class inheriting this class).

Q: Are private class-level variables inherited?

Ans: Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.

Q: Describe the accessibility modifier “protected internal”.

Ans: It is available to classes that are within the same assembly and derived from the specified base class.

Q: What’s the top .NET class that everything is derived from?

Ans: System.Object

Q: What does the term immutable mean?

Ans: The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

No comments: