C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
And: This can help with a complex system as it is developed. This example uses NotImplementedException in an unimplemented method.
Example: The method signature returns an integer value. A compile-time error would occur if the method simply had a blank body.
Int, uintResult: The NotImplementedException prevents this from happening and so keeps the program compiling.
C# program that uses NotImplementedException
using System;
class Program
{
static void Main()
{
Method();
}
static int Method()
{
// Leave this as a stub.
throw new NotImplementedException();
}
}
Output
Exception message is printed to screen.
Therefore: When the NotImplementedException occurs, you will realize that the problem is unfinished code—not another error.
Finally: Visual Studio inserts the NotImplementedException in method stubs such as in Windows Forms programs. It is a convention.