VB.net Program to Check an Object Is Initialized or Not

You are currently viewing VB.net Program to Check an Object Is Initialized or Not

VB.Net program to check an object is initialized or not

'Vb.Net program to check an object is initialized or not.

Module Module1
    Class Sample
        Public Sub SayHello()
            Console.WriteLine()
        End Sub
    End Class
    
    Sub Main()
        Dim obj As Sample
        Dim ret As Boolean

        ret = IsNothing(obj)

        If (ret = True) Then
            Console.WriteLine("Object obj is not initialized")
        Else
            obj.SayHello()
        End If
    End Sub
End Module
Object obj is not initialized
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply