You are creating a class to compare a specially-formatted string. The default collation
comparisons do not apply. You need to implement the IComparable(Of String) interface.
Which code segment should you use?
A. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As String)
As _Integer Implements IComparable(Of String).CompareTo...End FunctionEnd Class
B. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As Object)
As _Integer Implements IComparable(Of String).CompareTo...End FunctionEnd Class
C. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As String)
_As Boolean Implements IComparable(Of String).CompareTo...End FunctionEnd Class
D. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As Object)
_As Boolean Implements IComparable(Of String).CompareTo...End FunctionEnd Class
Answer: A
comparisons do not apply. You need to implement the IComparable(Of String) interface.
Which code segment should you use?
A. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As String)
As _Integer Implements IComparable(Of String).CompareTo...End FunctionEnd Class
B. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As Object)
As _Integer Implements IComparable(Of String).CompareTo...End FunctionEnd Class
C. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As String)
_As Boolean Implements IComparable(Of String).CompareTo...End FunctionEnd Class
D. Public Class Person
Implements IComparable(Of String)Public Function CompareTo(ByVal other As Object)
_As Boolean Implements IComparable(Of String).CompareTo...End FunctionEnd Class
Answer: A
No comments:
Post a Comment