How to fix "No overload for method" takes 0 arguments "?

How can I fix this error?

"No overload for the 'output' method takes 0 arguments.

The error is at the very bottom on "fresh.output ();".

I do not know what I am doing wrong. Can someone tell me what should I do to fix the code?

Here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication_program
{
    public class Numbers
    {
        public double one, two, three, four;
        public virtual void output(double o, double tw, double th, double f)
        {
            one = o;
            two = tw;
            three = th;
            four = f;
        }
    }
    public class IntegerOne : Numbers
    {
        public override void output(double o, double tw, double th, double f)
        {
            Console.WriteLine("First number is {0}, second number is {1}, and third number is {2}", one, two, three);
        }
    }
    public class IntegerTwo : Numbers
    {
        public override void output(double o, double tw, double th, double f)
        {
            Console.WriteLine("Fourth number is {0}", four);
        }
    }
    class program
    {
        static void Main(string[] args)
        {
            Numbers[] chosen = new Numbers[2];

            chosen[0] = new IntegerOne();
            chosen[1] = new IntegerTwo();

            foreach (Numbers fresh in chosen)
            {
                fresh.output();
            }     
            Console.ReadLine();
        }
    }
}
+4
source share
5 answers

He tells you that the "output" method needs arguments. Here is the signature for "output":

public override void output(double o, double tw, double th, double f)

So, if you want to call it, you need to go four times.

fresh.output(thing1,thing2,thing3,thing4);

Or use hard-coded values ​​as an example:

fresh.output(1,2,3,4);
+10
source

output, 0 , , 4 . output():

foreach (Numbers fresh in chosen)
{
    fresh.output(o, tw, th, f);
}
+3

output 0 (), , 4 . , , output .

0

output . , .

:

fresh.output(1, 2, 3, 4);
0

fresh.output() 2 ,

0

All Articles