VB.Net program to demonstrate the NotImplementedException

Here, we are going to demonstrate the NotImplementedException in VB.Net.
Submitted by Nidhi, on January 07, 2021 [Last updated : March 08, 2023]

NotImplementedException in VB.Net

Sometimes we create a function but do not implement it. Then this kind of function may generate NotImplementedException. Here we will demonstrate NotImplementedException in our program.

Program/Source Code:

The source code to demonstrate the NotImplementedException is given below. The given program is compiled and executed successfully.

VB.Net code to demonstrate the example of NotImplementedException

'Vb.Net program demonstrates the NotImplementedException.

Imports System.IO

Module Module1
    Sub FutureFunctionality()
        Throw New NotImplementedException()
    End Sub

    Sub Main()
        Try
            'This function is not implemented yet.
            FutureFunctionality()
        Catch ex As NotImplementedException
            Console.WriteLine("Exception: " & ex.Message)
        End Try
    End Sub
End Module

Output

Exception: The method or operation is not implemented.
Press any key to continue . . .

Explanation

In the above program, we created a module Module1 that contains two functions FutureFunctionality() and Main().

The FutureFunctionality() function throw NotImplementedException.

The Main() function is the entry point for the program. Here, we called the FutureFunctionality() function that will generate NotImplementedException that will be caught in the catch block and print an appropriate message on the console screen.

VB.Net Exception Handling Programs »






Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.