C# MethodInfo IsFinal

Description

MethodInfo IsFinal Gets a value indicating whether this method is final.

Syntax

MethodInfo.IsFinal has the following syntax.


public bool IsFinal { get; }

Example


using System;/*from   w  w  w.jav  a2 s . c  om*/
using System.Reflection;

public class MyClass 
{
    public void MyMethod() 
    {
    }
    public static void Main() 
    {
        MethodBase m = typeof(MyClass).GetMethod("MyMethod");
        Console.WriteLine("The IsFinal property value of MyMethod is {0}.", m.IsFinal);
        Console.WriteLine("The IsVirtual property value of MyMethod is {0}.", m.IsVirtual);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo