beingtopper.jkp@gmail.com
+91-8700702530
Free Demo

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
  • Knowledge Base
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Ajmer
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
BCA NOTESVB.Net progrmas

Write a program to demonstrate Constructors and Destructors in VB.net.

Being Topper 17/10/2014 0 Comments

WAP to Demonstrate Constructors and Destructors in VB.net.

 

Imports System.Console

Module Module1

Class base

Private a As Integer

Private b As Double

Private c As String

 

Public Sub New(ByVal x As Integer, ByVal y As Double, ByVal z As String)

WriteLine("Constructor Of Base Class Executed ! ")

a = x

b = y

c = z

WriteLine("a=" & a)

WriteLine("b=" & b)

WriteLine("c=" & c)

End Sub

 

Protected Overrides Sub finalize()

WriteLine("Destructor of Base Class Executed ! ")

End Sub

End Class

 

Class derive : Inherits base

Private d As Integer

Public Sub New(ByVal e As Integer, ByVal x As Integer, ByVal y As Double, ByVal z As String)

MyBase.New(x, y, z)

WriteLine("Constructor of Derived Class Executed!")

d = e

WriteLine("d=" & d)

End Sub

Protected Overrides Sub finalize()

WriteLine("Destructor of Derived Class Executed ! ")

End Sub

End Class

 

Sub Main()

WriteLine("When WE Declare Object of Base Classs :- ")

WriteLine()

WriteLine()

Dim s1 As base = New base(20, 30.5, "GOGO")

 

WriteLine("When WE Declare Object of Derived Classs :- ")

WriteLine()

WriteLine()

Dim s2 As derive = New derive(10, 20, 30.5, "GOGO")

 

End Sub

 

End Module

OUTPUT

Program to implement Constructors and Destructors in VB.net

output of vb.net Program to implement Constructors and Destructors

constructors destructors polymorphism vb.net vbscript
1399 Views
AboutBeing Topper
In Socials:
PrevProgram in VB.Net to build a class which implements an interface17/10/2014
Best Antivirus to Keep Windows Safe01/06/2017Next

Related Posts

B.tech notesBasic ProgramsBCA NOTESInformation technologyJava ProgramsPrograms/Algorithm

java program for checking palindrome number

Palindrome Program in Java In this program, you’ll learn to check whether a...

Being Topper 18/02/2014
Algorithm Design and analysis ProgramsB.tech notesBCA NOTESC++ programInformation technology

c++ program to perform naive string matching

WRITE A PROGRAM TO PERFORM NAÏVE STRING MATCHING (more…)

Being Topper 25/05/2013
Categories
Recent Posts
  • Vipin Khutail Organizes International Conference for Digital Excellence 2, Elevating the Future of Technology
  • India’s Top Occult Science Enthusiasts Gather at AgyatOnSearch – Awards & Seminar in New Delhi
  • India’s Leading Digital Marketer, Vipin Khutail Interacted with Top Influencers of Delhi at BJP West Delhi’s Event
  • Vipin Khutail Organized Awards & Honor Ceremony to Celebrate Social Reformers on Doctor’s Day
  • Vipin Khutail organized International Conference on Educational Excellence & Honored Visionaries

Copyright © 2021 Being Topper ® . All Rights Reserved