美文网首页
First Java Code - Run a demo pro

First Java Code - Run a demo pro

作者: LinKuriboh | 来源:发表于2019-02-14 02:56 被阅读0次

    Coding Java

    the java filename should be the same as the name behind class statement, extention should be .java.

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

    ComplieTool:

    1. javac.exe
      complie java file, generate .class file
    C:\Users\Janus_admin\Documents\Oth\java>javac FirstJava.java
    
    1. java.exe
      execute the .class file, return the result.
      Attention: this step please don't add the extention
    C:\Users\Janus_admin\Documents\Oth\java>java FirstJava
    Hello, world!
    

    相关文章

      网友评论

          本文标题:First Java Code - Run a demo pro

          本文链接:https://www.haomeiwen.com/subject/jzhleqtx.html