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 are the shared variables?
What is non_deterministic finalization?
How do you use two datareaders at the same time in a vb.net windows application ?
what is commom language runtime?
What is multiple form in vb?
Why is the xml infoset specification different from the xml dom?
how can we assigns items on listbox so that it will show rowwise please write the code for it.
Explain strong name in .net assembly?
What are the advantages of VB.NET?
Which dll is used for microsoft .net run time?
I want to reduce my CPU Usage when I am querying the Database for records. Now my Winform App(in VB.Net) suddenly Jumps to 100% CPU Usage when i query for records from sql server database. I want this Usage to be less. Any help is appreciated
what is common type system?