using System;
class test
{
    public int max(int x, int y)
    {
        if (x > y)            return x;
        else
            return y;
    }
    public  void Main()
    {
        Console.WriteLine("the max of 6 and 8 is:{0}",max(6,8));    }
}
为什么会提示:不包含适合于入口点的静态"Main()"方法。请指点。

解决方案 »

  1.   

    静态"Main()"方法
    已经有提示了。
      

  2.   

    加上static,也是出现这个问题的,试过了不行。
      

  3.   

    2个方法一起加staticusing System;
    class test
    {
        public static int max(int x, int y)
        {
            if (x > y)            return x;
            else
                return y;
        }
        public static void Main()
        {
            Console.WriteLine("the max of 6 and 8 is:{0}", max(6, 8));    }
    }
      

  4.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;class test
    {
        public static int max(int x, int y)
        {
            if (x > y)            return x;
            else
                return y;
        }
        public static void Main()
        {
            Console.WriteLine("the max of 6 and 8 is:{0}", max(6, 8));    }
    }
      

  5.   

    public static void Main()   
    {}
    新建个cs文件,通过Main函数调用 
     
      

  6.   

    using System;
    class test
    {
      public static int max(int x, int y)
      {
      if (x > y)  return x;
      else
      return y;
      }
      public void Main()
      {
      Console.WriteLine("the max of 6 and 8 is:{0}",max(6,8));  }
    }
      

  7.   

    那个main方法应该是静态的吧,
          上面的那个方法是不是静态的都无所谓·
    using System;
    class test
    {
      public int max(int x, int y)
      {
      if (x > y)  return x;
      else
      return y;
      }
      public static void Main()
      {
      Console.WriteLine("the max of 6 and 8 is:{0}",max(6,8));  }
    }
      

  8.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;namespace ConsoleApplication2
    {
        class test
        {
            public int max(int x, int y)
            {
                if (x > y)                return x;
                else
                    return y;
            }
            public  static void Main()
            {
                test a = new test();
              
                Console.WriteLine("the max of 6 and 8 is:{0}",a.max(6,8));
                Console.Read();
            }
                
        }
                    }
      

  9.   

    有这道理么    class test
        {
            public int max(int x, int y)
            {
                if (x > y)                return x;
                else
                    return y;
            }
            public static void Main()
            {
                test t = new test();
                Console.WriteLine("the max of 6 and 8 is:{0}", t.max(6, 8));
            }
        }这样也完全没有问题么