PART II
C h a p t e r 2 1 :
E x p l o r i n g t h e S y s t e m N a m e s p a c e
657
Here are three sample runs:
5 2
4 4
1 6
The program works by first creating a
Random
object. Then it requests the two random
values, each between 1 and 6, inclusive.
Memory Management and the GC Class
The
GC
class encapsulates the garbage-collection facility. The methods defined by
GC
are
shown in Table 21-15. It defines the read-only property shown here:
public static int MaxGeneration { get; }
MaxGeneration
contains the maximum generation number available to the system. A
generation number indicates the age of an allocation. Newer allocations have a lower
number than older ones. Generation numbers help improve the efficiency of the garbage
collector.
For most applications, you will not use any of the capabilities of
Do'stlaringiz bilan baham: |