Last active
February 3, 2019 17:26
-
-
Save AnthonyDGreen/57ce7962700c5498894ad417296f9066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class Alarm | |
Private ReadOnly Code As Integer | |
ReadOnly Property Status As String = "Disarmed" | |
Sub New(code As Integer) | |
Me.Code = code | |
End Sub | |
Sub Arm() | |
' I'm motifying the value of this externally read-only property here. | |
_Status = "Armed" | |
End Sub | |
Function Disarm(code As Integer) As Boolean | |
If code = Me.Code Then | |
' And here. | |
_Status = "Disarmed" | |
Return True | |
Else | |
Return False | |
End If | |
End Function | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment