Explain Get, Let, Set Properties.



Explain Get, Let, Set Properties...

Answer / vishal sinha

The Let property is used to assign values to the attributes
of a class. The following is an example of a Let property.

Public Property Let Minute(ByVal m As Integer)
If (m >= 0 And m < 60) Then
mMinute = m
Else
mMinute = 0
End If
End Property


With Get and Set, it's as simple as it sounds...

The Get property is similar to a function in that it returns
a value. It is used return the attributes of a class. The
following is an example of a Get Property called Minute that
returns the private data member, mMinute.

Public Property Get Minute() As Integer
Minute = mMinute
End Property

Objects may not be assigned values directly. Instead, an
object reference is required. With properties, this is
achieved using the Set property.

Public Property Set EndTime(ByVal t As CClock)
Set mFinish = t
End Property

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

What do you mean by HTTP?

1 Answers  


Is it possible to change menu runtime using API? If yes? Specify the function names.

1 Answers  


What do you know about user forms.

1 Answers  


What is diff between the Generic Variable and Specific Variable?

1 Answers  


what are the Differences between ActiveX Control and Standard Control?

1 Answers   Wipro,


Different types of Passing Value?

1 Answers  


What is the differece between the (name) and caption properties of a control?

3 Answers  


Are there any examples of commercial applications built using Visual Basic?

1 Answers  


How would you create your application in DHTML?

1 Answers  


What is DSN?

1 Answers  


How do I speed up control property access?

1 Answers  


What is DBFailError?

1 Answers  


Categories