Question: Pay very close attention to the parameter types (ByVal vs ByRef) Spaces count towards the length of a string Private Sub btnBedrock_Click(ByVal sender As System.Object,

Pay very close attention to the parameter types (ByVal vs ByRef)

Spaces count towards the length of a string

Private Sub btnBedrock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBedrock.Click
 Dim strFullName As String = "Fred Flintstone"
 Dim strSecondName As String = "Barney Rubble" 
 
 CountLength(strFullName, strSecondName)
 lblEnd.Text = "My favorite was " & strSecondName
End Sub 
 
Private Sub CountLength(ByVal strFullName As String, ByRef strSecondName As String)
 lblFirst.Text = "The first name has " & strFullName.Length & " letters."
 lblSecond.Text = "The second name has " & strSecondName.Length & " letters."
 strSecondName = "Dino"
End Sub

What value will the lblFirst Label display after the user clicks on the btnBedrock Button?

What value will the lblSecond Label display after the user clicks on the btnBedrock Button?

What value will the lblEnd Label display after the user clicks on the btnBedrock Button?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!