C# Exception Finalize

In this chapter you will learn:

  1. Get to know Exception.Finalize
  2. Syntax for Exception.Finalize
  3. Returns for Exception.Finalize
  4. Example - Exception.Finalize

Description

Exception Finalize allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

Syntax

Exception.Finalize has the following syntax.


protected virtual void Finalize()

Returns

Exception.Finalize method returns

Example


using System;//  www. j a  va2s . co  m
public class MainClass{
  public static void Main(String[] argv){  
    Exception e = new Exception("asdf")
    
    System.Console.WriteLine(e.Finalize());
  }
}

Next chapter...

What you will learn in the next chapter:

  1. Get to know Exception.GetBaseException
  2. Syntax for Exception.GetBaseException
  3. Returns for Exception.GetBaseException
  4. Example - Exception.GetBaseException
Home »
  C# Tutorial »
    System »
      Exception
C# Exception Data
C# Exception HelpLink
C# Exception InnerException
C# Exception Message
C# Exception Source
C# Exception StackTrace
C# Exception TargetSite
C# Exception Exception()
C# Exception Exception(String)
C# Exception Exception(String, Exception)
C# Exception Equals(Object)
C# Exception Finalize
C# Exception GetBaseException
C# Exception GetHashCode
C# Exception GetType
C# Exception MemberwiseClone
C# Exception ToString