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()"方法。请指点。
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()"方法。请指点。
解决方案 »
- C#写的Winform如何直接链到远程SQL2000数据库?
- c#基础问题,请求帮忙!
- JS里跳转页面中URL地址内参数加密解密问题
- 各位大哥大姐小弟小妹--》》》GridView1问题!!!!
- C#内存释放问题
- picturebox和panel的MouseWheel事件怎么找不到了?
- 求助:如何将自动生成的cs文件直接编译成dll文件,将其输出到某一指定目录
- winform 中如何让checkedListBox选项横排
- 怎样将3个DataTable(结构都相同)都加入到一个DataView中,然后在进行排序
- 数据库提交问题,急呀,在线等候
- 求救!在windowService用Process.Start()启动程序没有界面
- C#开发的控件可不可以用于“Delphi”
已经有提示了。
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)); }
}
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)); }
}
{}
新建个cs文件,通过Main函数调用
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)); }
}
上面的那个方法是不是静态的都无所谓·
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)); }
}
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();
}
}
}
{
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));
}
}这样也完全没有问题么