导航

第一课 Hello World程序

Posted on 2018-09-16 22:11  风暴只灵  阅读(362)  评论(0编辑  收藏  举报

  接触一门编程语言都是从HelloWorld开始的。我们以Idea为开发工具,写一个JAVA版的HelloWorld。

  1,启动idea,点击菜单 File->New->Project

   新建一个Java工程

  2,右键点击src目录 New->Java Class 在新建的文件中打开写入以下代码

public class HelloWorld {
    public static void main(String[] args)
    {
        System.out.println("hello world");
    }
}

  3,运行后结果如下

Connected to the target VM, address: 'javadebug', transport: 'shared memory'
hello world
Disconnected from the target VM, address: 'javadebug', transport: 'shared memory'

Process finished with exit code 0