General C# stuff Flashcards

1
Q

Difference between Response.Write() andResponse.Output.Write().
1. Response.Output.Write() allows you to buffer output
2. Response.Output.Write() allows you to write formatted output
3. Response.Output.Write() allows you to flush output
4. Response.Output.Write() allows you to stream output

A

Response.Output.Write() allows you to write formatted output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In C# “using” is
1. Function
2. Class
3. Directive
4. Method

A

Directive. It allows you to specify the namespace in the program. This card referes to the directive. However, there is also a using statement that allows for proper disposal of disposable objects. The latter is used in resource management

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the access modifiers in C#?

A
  • public (full visibility. All classes can access it)
  • private (restricted visibility. Can only be used within the class that declared it)
  • protected (can only access it within the same class. However, if the class gets inhertited, the child class can also access the protected members)
  • internal (The code is only accessible within its own assembly, but not from another assembly)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Are interface methods in C# public by default

A

Yes they are public and abstract by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is an 8-byte integer?
1. Char
2. Long
3. Short
4. Integer

A

Long

https://www.w3schools.com/cs/cs_data_types.php

How well did you know this?
1
Not at all
2
3
4
5
Perfectly