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

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 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.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.