Is there an error in the below code? [code] Private _dblBonus As Double Public ReadOnly Property Bonus As Double Set(ByVal value As Decimal) _db

Duyên Trương

New member
Is there an error in the below code?
Code:
Private _dblBonus As Double
Public ReadOnly Property Bonus As Double
Set(ByVal value As Decimal)
_dblBonus = value
End Set
End Property
A. No error
B. Runtime Error
C. Compilation Error
D. Syntax error
 
Answer: C
Explanation: If the header contains the ReadOnly keyword, you include only a Get block of code in the Property procedure The Get block is such a method, which is used to read private members. If the header contains the WriteOnly keyword, you include only a Set block of code in the Property procedure. The Set block is such a method, which is used to change private members.
 

Tìm kiếm

Back
Top