I understand that a class should implement all the methods of a interface. However I have seen that if that class is extending a class with the method in then the interface is not complete.
Consider the following code...
Strict
Interface inter_i
Method draw:Void(n:Int)
End Interface
Class lvl1_c
Method draw:Void(n:Int)
Print "levl1_c printing - "+n
End Method
End Class
Class lvl2_c Extends lvl1_c Implements inter_i
'draw is implemented in lvl1_c
' Method draw:Void(n:Int)'
' Print "levl2_c printing - "+n
' End Method
End Class
Function Main:Int()
Local a:inter_i = New lvl2_c
a.draw(34)
Return 0
End Function
Now this looks like it *should* work, but does not.
Trying to compile the above results in a lvl2_c must implement the draw method error. Is this right?
|