Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java FizzBuzz程序中的运行时错误是什么?_Java - Fatal编程技术网

Java FizzBuzz程序中的运行时错误是什么?

Java FizzBuzz程序中的运行时错误是什么?,java,Java,它在我的个人电脑IDE中运行良好,但当我将此程序提交到像ideone.com这样的在线IDE时,会出现运行时错误。我需要将此程序提交到codeeval.com以完成我的挑战,但再次出现错误: 错误:无法找到或加载main类main 代码: “错误:无法找到或加载main类main”提示出现此问题 如果您访问ideone.com,默认代码如下: /* Name of the class has to be "Main" only if the class is public. */ class I

它在我的个人电脑IDE中运行良好,但当我将此程序提交到像ideone.com这样的在线IDE时,会出现运行时错误。我需要将此程序提交到codeeval.com以完成我的挑战,但再次出现错误:


错误:无法找到或加载main类main

代码:

“错误:无法找到或加载main类main”提示出现此问题

如果您访问ideone.com,默认代码如下:

/* Name of the class has to be "Main" only if the class is public. */
class Ideone

因此,类需要是
class Ideone
public class Main
才能在那里编译。

尝试在
class FizzBuzz{
前面添加
public
关键字。我想你的“输入”密钥有问题当你在你的机器上运行它时,它能工作吗?我刚刚在ideone上试用过,它对我有效。不正确。该类可以在它仍然工作的情况下重命名。事实上,发布的示例
/* Name of the class has to be "Main" only if the class is public. */
class Ideone