Answer the question
In order to leave comments, you need to log in
Inheritance in C#: changing the return type - how to fix the error?
abstract class ALauncher
{
protected abstract Object parseArgs(string[] args);
}
class Launcher : ALauncher
{
protected override ABitFileManager parseArgs(string[] args) {...}
}
Answer the question
In order to leave comments, you need to log in
Generalizations can probably help you.
interface ILauncher
{
object ParseArgs(string[] args);
}
abstract class ALanucher<T> : ILauncher
{
protected abstract T ParseArgs(string[] args);
object ILanucher.ParseArgs(string[] args)
{
return ParseArgs(args);
}
}
class Launcher : ALanucher<int>
{
protected override int ParseArgs(string[] args)
{
throw new NotImplementedException();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question