Programming in Visual Basic.Net by Dr. Raja Subramanian

Programming in Visual Basic.Net by Dr. Raja Subramanian

Author:Dr. Raja Subramanian [Subramanian, Dr. Raja]
Language: eng
Format: azw3
Publisher: Acme Learning Private Limited
Published: 2011-04-27T16:00:00+00:00


Figure 8.2 The execution of the ConsoleApplication1 ConsoleApplication2

The source code in the Module1 of the ConsoleApplication2 is shown in Figure 8.3. Module Module1

Class base_class_1

Public integer_member_1 As Integer

Public Sub New(ByVal integer_data As Integer)

Console.WriteLine()

Console.WriteLine(“EXECUTING CONSTRUCTOR IN BASE CLASS”) Console.WriteLine()

Me.integer_member_1 = integer_data

End Sub Public Sub output_data_base_class()

Console.WriteLine()

Console.WriteLine(“INTEGER DATA IN BASE CLASS IS “ & integer_member_1) Console.WriteLine()

End Sub

End Class

Class derived_class_1

Inherits base_class_1 Public Sub New(ByVal integer_data As Integer)

MyBase.New(integer_data)

Console.WriteLine()

Console.WriteLine(“EXECUTING CONSTRUCTOR IN DERIVED CLASS”) Console.WriteLine()

End Sub Public Sub output_data_derived_class()

Console.WriteLine()

Console.WriteLine(“INTEGER DATA IN DERIVED CLASS IS “ & integer_member_1) Console.WriteLine()

End Sub

End Class

Sub Main()

‘PROGRAMMING IN VISUAL BASIC.NET

‘AUTHOR: Dr.RAJA SUBRAMANIAN Dim class_data_1 As New derived_class_1(1001)

class_data_1.output_data_base_class()

class_data_1.output_data_derived_class()

Console.ReadLine()

End Sub

End Module

Figure 8.3 The source code in the Module1 of the ConsoleApplication2

The execution of the ConsoleApplication2 creates the output shown in Figure 8.4.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.