##final = sealed
###Classes
sample.java
public final class MyFinalClass {...}
sample.cs
public sealed class MyFinalClass {...}
###Method
Prevent overriding of a virtual method.
sample.java
public class MyClass
{
public final void myFinalMethod() {...}
}
sample.cs
public class MyClass : MyBaseClass
{
public sealed override void MyFinalMethod() {...}
}
###Variables
To only allow a variable to be assigned once:
sample.java
public final double pi = 3.14; // essentially a constant
sample.cs
public readonly double pi = 3.14; // essentially a constant