2つの「出力」で「オーバーライドする適切なメソッドが見つかりません」というエラーが発生し続けます。どうすれば修正できますか?
配列を使用して、最初の文に 4、5、および 6 の数字を配置し、2 番目の文に 7 を配置するにはどうすればよいですか?
これが私がこれまでに行ったことです:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication_program
{
public class Numbers
{
public virtual void output()
{
}
}
public class IntegerOne : Numbers
{
public override void output(double o, double tw, double th)
{
one = o;
two = tw;
three = th;
}
}
public class IntegerTwo : Numbers
{
public override void output(double f)
{
four = f;
}
}
class program
{
static void Main(string[] args)
{
Numbers[] chosen = new Numbers[2];
chosen[0] = new IntegerOne(4, 5, 6);
chosen[1] = new IntegerTwo(7);
Console.WriteLine("First number is {0}, second number is {1}, and third number is {2}", ;
Console.WriteLine("Fourth number is {0}", ;
Console.ReadLine();
}
}
}