-4

GetDFT()次のプログラムでメソッドを呼び出すにはどうすればよいですか?

namespace Lott_CSC445_Project6
{
    class Program
    {    
        ... // declarations removed for brevity

        static void Main(string[] args)
        {
            ... // some code

            GetDFT() // <<< Call the method here

            ... // more code
        }

        public void GetDFT()
        {
            ... // method body removed for brevity
        }    
    }
}
4

1 に答える 1

2

メソッドは ではないstaticため、 のインスタンスメソッドですProgram

つまり、それProgramを呼び出すには のインスタンスが必要です。

または、メソッドを作成しstaticます。

于 2013-03-09T19:40:40.380 に答える