第一个C#程序“Hello World”出错

sunrise10 2003-08-30 11:11:55
今天开始学C#,第一个程序出错,请各位多多指教.
using System;
namespace ClassHelloWorld
{
public class ClassHelloWorld
{
public static int main(String[] args);
System.Console.WriteLine("Hi,Hello World");
return 0;
}
}
...全文
104 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunhong168 2003-08-31
  • 打赏
  • 举报
回复
呵呵
coudoufu 2003-08-31
  • 打赏
  • 举报
回复
呵呵
upzone 2003-08-31
  • 打赏
  • 举报
回复
你的错误有两个
a).Main首字母应该大写;
b).在 Main() 少了 {} ??
seaviose 2003-08-31
  • 打赏
  • 举报
回复
你看得什么书呀
这么垃圾,换本吧,别误了自己!
using System;

namespace ClassHelloWorld
{
public class ClassHelloWorld
{
public static void Main (String[] args)
{
System.Console.WriteLine("Hi,Hello World");
}
}
}

ytzyf 2003-08-31
  • 打赏
  • 举报
回复
to 回复人: sunrise10(*冷雨夜*)

我也是新手,我们一起进步吧:)
QQ:99836836

zyycode 2003-08-31
  • 打赏
  • 举报
回复
把书烧了吧,免得让书再害人...
注意:创建要是控制台应用程序,不是WINDOWSAPPLICATION:>
xiaojiz 2003-08-31
  • 打赏
  • 举报
回复
using System;

namespace Classhelloworld
{
public class Classhelloworld
{
public static void Main(string[] args)
{
Console.WriteLine("Hi,Hello World");
}
}
}

就是啊,“M”是答谢,int 改为 void ,不要返回值,再试一下,我等你。。。。。好了么
chanet 2003-08-31
  • 打赏
  • 举报
回复

在 Main() 怎么没有 {} ??

Amilsx 2003-08-31
  • 打赏
  • 举报
回复
受不了了.........hello world程序都会出错......随便找本c#的书上都有正确答案............
XiaoCsharp 2003-08-30
  • 打赏
  • 举报
回复
你那是什么书
樟树林的世界 2003-08-30
  • 打赏
  • 举报
回复
要有一个主class.
sjun66 2003-08-30
  • 打赏
  • 举报
回复
把你现在那本书仍了吧,越看越糟糕的
cppTrier 2003-08-30
  • 打赏
  • 举报
回复
是的是的 C#和C++不一样 C++的main()首字母是小写的,C#的 Main()是大写的
ego 2003-08-30
  • 打赏
  • 举报
回复
改成:
using System;
namespace ClassHelloWorld
{
public class ClassHelloWorld
{
public static int Main(string[] args)
{
System.Console.WriteLine("Hi,Hello World");
return 0;
}
}
}

注意大小写

5200 2003-08-30
  • 打赏
  • 举报
回复
入口点Main大小写要分清,后面要跟{}包围的函数体,并且不能有返回值
sunrise10 2003-08-30
  • 打赏
  • 举报
回复
我晕,现在的书是怎么写的,第一个程序出现这种错误
sunrise10 2003-08-30
  • 打赏
  • 举报
回复
大家不欢迎我就加入C#队伍中来吗?
还是很难,不会吧?
自己顶一下
saucer 2003-08-30
  • 打赏
  • 举报
回复



using System;

namespace ClassHelloWorld
{
public class ClassHelloWorld
{
public static void Main (String[] args)
{
System.Console.WriteLine("Hi,Hello World");
}
}
}
心雨楼 2003-08-30
  • 打赏
  • 举报
回复
把书给我!

110,501

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧