== Noncompliant Code Example

----
public class Fruit 
{
  public double GetCost() 
  {
    return 3.5;
  } 
}

public class Raspberry : Fruit 
{
  public new double GetCost()  // Noncompliant
  { 
    return 7.5;
  }
}

// ...
var r = new Raspberry();
var f = (Fruit) r;
Console.WriteLine(r.GetCost());  // prints 7.5
Console.WriteLine(f.GetCost());  // prints 3.5; there's only one instance but different code executes depending on cast
----
