I see many methods that specify an interface as return value. Is my thought true that it means: my method can return every class type that inherits from that interface? if n
Yes, your method could return any type that implements that interface.
Here is an example:
using System;
class Foo
{
public IComparable GetComparable()
{
// Either of these return statements
// would be valid since both System.Int32
return 4;
// and System.String
return "4";
// implement System.IComparable
}
}