Set - 8

Question 6 :

What does Dispose method do with the connection object?

Answer :

Deletes it from the memory.

Question 7 :

How do you generate documentation from the C# file commented properly with a command-line compiler?

Answer :

Compile it with a /doc switch.

Question 8 :

When you inherit a protected class-level variable, who is it available to?

Answer :

Classes in the same namespace.

Question 9 :

How can I get the ASCII code for a character in C#?

Answer :

Casting the char to an int will give you the ASCII value: char c = 'f'; System.Console.WriteLine((int)c); or for a character in a string: System.Console.WriteLine((int)s[3]); The base class libraries also offer ways to do this with the Convert class or Encoding classes if you need a particular encoding.

Question 10 :

Is there an equivalent to the instanceof operator in Visual J++?

Answer :

C# has the is operator:
expr is type