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(6,8));
}
}我在public void Main()这里加入了static,提示非静态方法或属性,初学!我是照书做的!
public int max(int x,int y){
if(x>y)
return x;
else
return y;
}
public void Main(){
Console.WriteLine("the:",max(6,8));
}
}我在public void Main()这里加入了static,提示非静态方法或属性,初学!我是照书做的!
解决方案 »
- 如何得到图片地址
- List<类> 使用findall 提示没有findall
- C# : 很 少 有 人 问 这 样 的 问 题
- 关于ASP.NET的WEB登陆程序问题!
- oledb 连接excel 返回的dataset中 标题列乱码
- 求高人帮忙用C# 或者Vb 写个简单程序 急!
- 在C#.net中:form1中用类创建了个对象。在form2中如何利用from1中的对象呀?急!!!
- WPF,请问下这个路由事件怎么截取?
- 关于C#.NET中使用HTML编辑器的问题
- 关于用VSS进行源码管理的问题
- 一个关于winform下treeview的数据问题
- 菜鸟提问!关于C#编译器(基于.NET下的FCL的即时编译器)的问题
2.提示非静态方法或属性,同楼上,static方法只能调用static方法。
public static void Main(){
[STAThread]是定义程序是单线程的
{
Application.Run(new PlaySound());
}
static void Main()
{
Application.Run(new Form1());
}