C# Enum Finalize
In this chapter you will learn:
Description
Enum Finalize
allows an object to try to free resources
and perform other cleanup operations before it is reclaimed by garbage collection.
Syntax
Enum.Finalize
has the following syntax.
protected virtual void Finalize()
Returns
Enum.Finalize
method returns
Example
The following example illustrates the use of the Finalize method.
//from ww w . j a v a2 s . c om
using System;
enum Mammals { Cat, Dog, Horse, Dolphin };
public class EqualsTest {
public static void Main() {
Mammals myPet = Mammals.Cat;
Mammals yourPet = Mammals.Dog;
Console.WriteLine(myPet.Finalize());
}
}
Next chapter...
What you will learn in the next chapter:
- Get to know Enum.Format
- Syntax for Enum.Format
- Parameter for Enum.Format
- Returns for Enum.Format
- Example - Enum.Format
C# Enum Enum
C# Enum CompareTo
C# Enum Equals
C# Enum GetHashCode
C# Enum GetName
C# Enum GetNames
C# Enum GetType
C# Enum GetTypeCode
C# Enum GetUnderlyingType
C# Enum GetValues
C# Enum HasFlag
C# Enum IsDefined
C# Enum MemberwiseClone
C# Enum Parse(Type, String)
C# Enum Parse(Type, String, Boolean)
C# Enum ToObject(Type, Byte)
C# Enum ToObject(Type, Int16)
C# Enum ToObject(Type, Int32)
C# Enum ToObject(Type, Int64)
C# Enum ToObject(Type, Object)
C# Enum ToObject(Type, SByte)
C# Enum ToObject(Type, UInt16)
C# Enum ToObject(Type, UInt32)
C# Enum ToObject(Type, UInt64)
C# Enum ToString()
C# Enum ToString(IFormatProvider)
C# Enum ToString(String)
C# Enum ToString(String, IFormatProvider)
C# Enum TryParse(String, TEnum)
C# Enum TryParse(String, Boolean, TE...
C# Enum CompareTo
C# Enum Equals
C# Enum Finalize
C# Enum FormatC# Enum GetHashCode
C# Enum GetName
C# Enum GetNames
C# Enum GetType
C# Enum GetTypeCode
C# Enum GetUnderlyingType
C# Enum GetValues
C# Enum HasFlag
C# Enum IsDefined
C# Enum MemberwiseClone
C# Enum Parse(Type, String)
C# Enum Parse(Type, String, Boolean)
C# Enum ToObject(Type, Byte)
C# Enum ToObject(Type, Int16)
C# Enum ToObject(Type, Int32)
C# Enum ToObject(Type, Int64)
C# Enum ToObject(Type, Object)
C# Enum ToObject(Type, SByte)
C# Enum ToObject(Type, UInt16)
C# Enum ToObject(Type, UInt32)
C# Enum ToObject(Type, UInt64)
C# Enum ToString()
C# Enum ToString(IFormatProvider)
C# Enum ToString(String)
C# Enum ToString(String, IFormatProvider)
C# Enum TryParse
C# Enum TryParse