Difference between a sub and a function?
Answers were Sorted based on User's Feedback
Answer / m.sivakumar
A Sub Procedure is a method will not return a value
A sub procedure will be defined with a Sub keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine (My name is: & myName)
End Sub
A function is a method that will return value(s).
A function will be defined with a Function keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer)
As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
Is This Answer Correct ? | 21 Yes | 2 No |
Answer / satishdubey
A Sub Procedure is a method will not return a value
A sub procedure will be defined with a Sub keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine (My name is: & myName)
End Sub
A function is a method that will return value(s).
A function will be defined with a Function keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As
Integer)
As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function
Is This Answer Correct ? | 7 Yes | 4 No |
What is a literal control?
What are the shadow variables?
what is vb.net
when do we need a multiple document interface?
What is the DIfference between Friend and Protected Friend?
6 Answers CTS, Sykes Enterprises, TCS,
difference between checkbox vs radiobutton??
What is datatype conversion?
When do you use virutal keyword?
i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?
Explain the difference between .dll extension and .exe extension files?
what is the base class of .net?
What is redim keyword and its use?