Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-4-20250514· AnthropicHugging Face LMArena Human Preference 140K

用java写一个helloworld

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with o4-mini-2025-04-16’s answer.
  1. User

    用java写一个helloworld

  2. Claude Assistant

    这里是一个简单的Java Hello World程序:

    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello, World!");
        }
    }
    

    要运行这个程序,你需要:

    1. 将代码保存为 HelloWorld.java 文件
    2. 在命令行中编译:javac HelloWorld.java
    3. 运行编译后的程序:java HelloWorld

    程序会在控制台输出 "Hello, World!"。

    如果你想输出中文,也可以这样写:

    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("你好,世界!");
        }
    }
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.