Re: covariant return type
I've moved this thread to a more appropriate forum. For more information, read this: The Member Introductions Forum is for saying hi, NOT for technical questions!
Also, when posting code, please remember to use the highlight tags.
Re: covariant return type
Quote:
incompatible types
found : MySubClass
required: MySuperClass
The compiler's error message explains the problem.
Do you understand about data types? The compiler will NOT allow you to use a variable of the wrong type.
What type does the method's definition say that the method returns?
What type is the mscl variable?
Are they the same or compatible? The compiler does not think they are.