VB.NET继承对象,将对象作为变量传递

时间:2019-07-04 01:27:38

标签: vb.net

有没有一种方法可以从“ A”创建对象“ B”而不必设置每个单独的属性,我非常希望实现这一目标:

Class A
Public Property1 as integer
Public Property2 as integer
Public Property...
End class

Class B
Inherits A
Public Addtional_Property as integer

Sub New(Input as A)
 Me = Input
End Sub
End class

代替此:

Sub New(Input as A)
Me.Property1 =Input.Property1 
Me.Property2 =Input.Property3 
Me.Property... =Input.Property... 
End Sub

0 个答案:

没有答案