Which of the following statement is wrong in case of Constructors in VB.NET ?

A) Constructors are always named as New
B) Constructors do not return anything
C) Constructors can not be parameterized
D) Constructors are implicitly called when an object is created

Showing Answers 1 - 3 of 3 Answers

B) Constructors do not return anything

Construnctors can have parameters with different data types and different no. of parameters.

Have a look at below ex:

-------------

Public Class Class1

   Sub New()

   End Sub

   Sub New(ByVal s As String)

   End Sub

   Sub New(ByVal a As String, ByVal i As Integer)

   End Sub

End Class

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions