The source code to get the maximum number of generations that the system currently supports is given below. The given program is compiled and executed successfully.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Total number of HEAP generations are: " + GC.MaxGeneration);
Console.WriteLine();
}
}
}
Output:
Total number of HEAP generations are: 2
Press any key to continue . . .
Program:
The source code to get the maximum number of generations that the system currently supports is given below. The given program is compiled and executed successfully.
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer