*
Previous C# Question Answers-101 - 110 C# Threading QA-1-10 Next

C# (C-Sharp) Question Answers - 111-120

111. Maximum memory a single process can address on Windows?

Maximum Memory Addressable by a Single Process on Windows

32-bit Windows

  • Maximum virtual memory per process: 3 GB (with `/3GB` switch)

64-bit Windows

  • 32-bit process: 4 GB (due to address space limits)
  • 64-bit process: Up to ~7 TB depending on system and OS limits

Note: Actual usable memory may vary based on system configuration, OS version, and available physical memory.

112. What is the Output?

using System;
static int Compute(int a)
{
    if (a <= 1) return 1;
    return a + Compute(a - 2);
}

static void Cal(int a)
{
    if (a >= 1)
    {
        Console.Write("{0}, ", a);
        a -= 2;
        Cal(a);
    }
}

public static void Main()
{
    const int Number = 9;

    Console.WriteLine("Result "); Cal(Number);
    Console.WriteLine();
    Console.WriteLine("Result:  {0}\n", Compute(Number));
}

Output:

Result
9, 7, 5, 3, 1,
Result: 25

113. Role of the DataReader in ADO.NET?

Provides a read-only, forward-only rowset for fast sequential access to data.

114. What is serialization and deserialization? Types?

Serialization: Converts object to stream of data for storage or transmission. Deserialization: Reconstructs object from data stream.

115. Syntax to inherit from a class in C#?

class MyNewClass : MyBaseClass { }

116. Whatis the output?

        Number1 = 235, Number2 = 50;
        Maximum = (Number1 < Number2) ? Number2 : Number1;

Result will be that Maximum = 235.

117. What are variable parameters?

In C# variable parameters can be defined using the “params” Key word:

            //Allows to pass in any number and any type of parameters
            public static void Program(params object[] args){}
Note: Only one params keyword is permitted per method. If more than one parameter used then ‘params’ has to be the last parameter.

118. What is this? Can it be used in static method?

this refers to current object instance. Cannot be used in static methods.

119. What ports must be open for DCOM over firewall? Purpose of port 135?

DCOM uses RPC; default port 135 is Remote Procedure Call service for object communication.

120. What technology enables out-of-proc communication in .NET?

.NET Remoting through marshalling.

Back to Index
Previous C# Question Answers-101 - 110 C# Threading QA-1-10 Next
*
*